Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement session based authentification #88

Merged
merged 3 commits into from
May 15, 2020

Conversation

maxaudron
Copy link
Contributor

This PR implements session based authentication as an alternative to using basic auth for each request.

In case session_auth is set to true (default false) NewClient() makes a call to /users/me with basic auth and saves the returned cookies into the the Client object.

The NewRequest() function uses these cookies if the Client has them set else uses basic auth.

Current limitation is that sessions expire after 15 minutes, a graceful retry mechanism should be added.

* uses session based authentification
* retrives session cookie once at module init
* session token expires after 15 minutes
* TODO implement graceful catching of auth failure and retry getting a
  new token
@marinsalinas
Copy link
Contributor

@maxaudron, Could you please update the documentation, to add an example of how to set session auth with terraform?

@ghost ghost added the documentation label Apr 23, 2020
@marinsalinas marinsalinas merged commit 18e65e6 into nutanix:master May 15, 2020
yannickstruyf3 pushed a commit to yannickstruyf3/terraform-provider-nutanix that referenced this pull request Nov 9, 2021
implement session based authentification
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants