Feature Request - Allow authentication using sessionID
See original GitHub issueScenario/Intent
Python SDK version 4.3.0 has included support for authentication using a sessionID. Thus, I want to reuse a valid and active OneView session on my Ansible playbooks instead of creating a new session every time. It will be faster (no need to auth for each resource, just pass the session token), use less resources (OV stores info for each session created), and will allow for using resources without having to put the user/pass in everyone.
Important: Previous authentication methods should not be removed to keep backward compatibility.
Environment Details
- python-hpOneView SDK Version: 4.3.0
Expected Result
1- There should be a login module or action plugin that receives username/password and returns the sessionID and 2 - all the other modules should support “sessionID” besides username and password for authentication.
Something like:
- name: Create a Fibre Channel Network
oneview_fc_network:
hostname: {{ ip }}
sessionId: {{ sessionID }}
api_version: 500
state: present
data:
name: "{{ network_name }}"
fabricType: 'FabricAttach'
linkStabilityTime: '30'
autoLoginRedistribution: true
no_log: true
delegate_to: localhost
Other authentication methods (JSON and environment variables) should be updated to allow the reuse of a session too.
Actual Result
sessionID is not supported, thus user must pass username/password for each module (via parameter, JSON or environment variables).
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5
Both Ansible SDK and underlying python SDK supports sessionID.
By adding sessionID to the credentials of the config.json like the below { “ip”: “172.25.105.12”, “credentials”: { “sessionID”: “AuthToken”, }, “api_version”: 1800 }
By Setting the ONEVIEWSDK_SESSIONID in the Environment Variables for example export ONEVIEWSDK_IP=‘172.16.102.82’ export ONEVIEWSDK_SESSIONID=‘AuthToken’
Both the options config.json and environment variables are tested running the playbooks and are working as expected. Please get back to us just in case.
SessionID related documentation updated in the README.md for the project. Closing the issue.