-
Notifications
You must be signed in to change notification settings - Fork 73
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 support for re-authentication #467
Merged
Merged
+2,387
−727
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TODO: * all of it ;)
This allows old protocol connections to reject session authentication tokens (Bolt < 5.1)
Signed-off-by: Florent Biville <florent.biville@neo4j.com>
Don't call the driver token manager's OnTokenExpired when a session auth token has been provided.
Signed-off-by: Florent Biville <florent.biville@neo4j.com>
Signed-off-by: Florent Biville <florent.biville@neo4j.com>
Signed-off-by: Florent Biville <florent.biville@neo4j.com>
Signed-off-by: Florent Biville <florent.biville@neo4j.com>
Thank you staticcheck! Signed-off-by: Florent Biville <florent.biville@neo4j.com>
Signed-off-by: Florent Biville <florent.biville@neo4j.com>
1aec18c
to
a273003
Compare
a273003
to
6c6c45e
Compare
Signed-off-by: Florent Biville <florent.biville@neo4j.com>
Signed-off-by: Florent Biville <florent.biville@neo4j.com>
Signed-off-by: Florent Biville <florent.biville@neo4j.com>
Signed-off-by: Florent Biville <florent.biville@neo4j.com>
Signed-off-by: Florent Biville <florent.biville@neo4j.com>
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ADR 012: re-authentication
This PR introduces two new auth mechanics for different use-cases
Note that all APIs introduced in this PR are previews
See https://github.com/neo4j/neo4j-go-driver/#preview-features
1) Auth Rotation
This is used for auth tokens that are expected to expire (e.g., SSO).
An
auth.TokenManager
instance may be passed to the driver instead of a static auth token.The easiest way to get started is using the provided
TokenManager
implementation. For example:
Note
This API is explicitly not designed for switching users.
In fact, the token returned by each manager must always belong to the same
identity. Switching identities using the
AuthManager
is undefined behavior.2) Session Auth
For the purpose of switching users, sessions can be configured with a static
auth token. This is very similar to impersonation in that all work in the
session will be executed in the security context of the user associated with
the auth token. The major difference is that impersonation does not require or
verify authentication information of the target user, however it requires
the impersonating user to have the permission to impersonate.
Note
This requires Bolt protocol version 5.3 or higher (Neo4j server 5.8+).