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

Add a query parameter to the get-session-key endpoint to allow returning an existing key #985

Closed
jeremystretch opened this issue Mar 22, 2017 · 3 comments
Labels
type: feature Introduction of new functionality to the application

Comments

@jeremystretch
Copy link
Member

Currently, a POST request to the /api/secrets/get-session-key/ endpoint will always generate a new SessionKey. This can be disruptive if a user is working in both the web UI and the API, as generating a new SessionKey will invalidate the cookie stored in the user's web browser. We should provide a mechanism to retrieve the existing SessionKey rather than generating a new one, to avoid this disruption.

@jeremystretch jeremystretch added API 2.0 type: feature Introduction of new functionality to the application labels Mar 22, 2017
@jeremystretch jeremystretch changed the title Add a query parameter to the get-session-key endpoint to allow returning an existing key instead of generating a new one Add a query parameter to the get-session-key endpoint to allow returning an existing key Mar 22, 2017
@jsenecal
Copy link
Contributor

jsenecal commented Mar 22, 2017 via email

@lampwins
Copy link
Contributor

@jsenecal beat me to the punch, JWT's really seem like the way forward here. No more sessions/cookies. So true RESTfulness.

@jeremystretch
Copy link
Member Author

To be clear, a session key is an entirely separate entity from the API token. Tokens are used for authentication across the entire API, whereas a session key (a new concept in v2.0) is used only for the encryption and decryption of secret data within the secrets endpoint. It doesn't really matter how the session key is stored (it can be passed as a cookie or as a header). The issue is that a user can only have one active session key at any point in time, and using multiple interfaces (or the same interface from multiple clients) introduces the possibility where one session invalidates the key another session is using.

lampwins pushed a commit to lampwins/netbox that referenced this issue Oct 13, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

3 participants