question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request - Allow authentication using sessionID

See original GitHub issue

Scenario/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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
satyasreenivascommented, Sep 3, 2020

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.

0reactions
satyasreenivascommented, Sep 29, 2020

SessionID related documentation updated in the README.md for the project. Closing the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Session Management - OWASP Cheat Sheet Series
The session ID or token binds the user authentication credentials (in the form of a user session) to the user HTTP traffic and...
Read more >
Session vs Token Based Authentication | by Sherry Hsu
In the session based authentication, the server will create a session for the user after the user logs in. The session id is...
Read more >
Session vs Token Authentication - Authgear
There are two main ways to do user authentication on the web, sessions and tokens. Before determining which method is better, it's crucial ......
Read more >
Keep user authentication using authToken or sessionId
Is there any way to keep user authentication or re-authenticate user using auth token or session id instead of login/password?
Read more >
Configure authentication session management - Microsoft Entra
Microsoft retired the configurable token lifetime feature for refresh and session token lifetimes on January 30, 2021 and replaced it with the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found