-
Notifications
You must be signed in to change notification settings - Fork 67
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
oidc: Reimplement userinfo for fine-grained error handling #31
Merged
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
5d71b3f
to
305ef45
Compare
apyrgio
pushed a commit
that referenced
this pull request
Jul 13, 2020
The `UserInfo` function of the `go-oidc` library doesn't expose details about the HTTP response from the OIDC Provider, if the request fails. This makes it impossible to detect if the returned code is `401`, in which case the user's session at the AuthService should be revoked. Initially, we were revoking the session on any error, but this caused undesired revocations because of errors we hadn't thought of (context cancellation). Reimplement the call to UserInfo and expose HTTP response details to the caller, so they can make a sensible decision. Github-PR: #31 Signed-off-by: Yannis Zarkadas <[email protected]>
apyrgio
pushed a commit
that referenced
this pull request
Jul 13, 2020
The UserInfo endpoint is called with an OAuth2 access token. The access token expires after a while and then we must renew it with the refresh token. Update the code so that it takes care of renewing the access token. Closes #32 Github-PR: #31 Signed-off-by: Yannis Zarkadas <[email protected]>
apyrgio
pushed a commit
that referenced
this pull request
Jul 13, 2020
Having multiple kubeconfig files confuses k3d, which doesn't know what kubeconfig file to use. Instruct it to always use the `$HOME/.kube/config` file. Github-PR: #31 Signed-off-by: Yannis Zarkadas <[email protected]>
apyrgio
pushed a commit
that referenced
this pull request
Jul 13, 2020
Add a unit test for the UserInfo function to make sure that we can get back the request info when an error occurs. Github-PR: #31 Signed-off-by: Yannis Zarkadas <[email protected]>
yanniszark
added a commit
that referenced
this pull request
Jul 13, 2020
The `UserInfo` function of the `go-oidc` library doesn't expose details about the HTTP response from the OIDC Provider, if the request fails. This makes it impossible to detect if the returned code is `401`, in which case the user's session at the AuthService should be revoked. Initially, we were revoking the session on any error, but this caused undesired revocations because of errors we hadn't thought of (context cancellation). Reimplement the call to UserInfo and expose HTTP response details to the caller, so they can make a sensible decision. Github-PR: #31 Signed-off-by: Yannis Zarkadas <[email protected]>
yanniszark
added a commit
that referenced
this pull request
Jul 13, 2020
Having multiple kubeconfig files confuses k3d, which doesn't know what kubeconfig file to use. Instruct it to always use the `$HOME/.kube/config` file. Github-PR: #31 Signed-off-by: Yannis Zarkadas <[email protected]>
yanniszark
added a commit
that referenced
this pull request
Jul 13, 2020
Add a unit test for the UserInfo function to make sure that we can get back the request info when an error occurs. Github-PR: #31 Signed-off-by: Yannis Zarkadas <[email protected]>
305ef45
to
a46cf71
Compare
The `UserInfo` function of the `go-oidc` library doesn't expose details about the HTTP response from the OIDC Provider, if the request fails. This makes it impossible to detect if the returned code is `401`, in which case the user's session at the AuthService should be revoked. Initially, we were revoking the session on any error, but this caused undesired revocations because of errors we hadn't thought of (context cancellation). Reimplement the call to UserInfo and expose HTTP response details to the caller, so they can make a sensible decision. Github-PR: #31 Signed-off-by: Yannis Zarkadas <[email protected]>
Having multiple kubeconfig files confuses k3d, which doesn't know what kubeconfig file to use. Instruct it to always use the `$HOME/.kube/config` file. Github-PR: #31 Signed-off-by: Yannis Zarkadas <[email protected]>
Add a unit test for the UserInfo function to make sure that we can get back the request info when an error occurs. Github-PR: #31 Signed-off-by: Yannis Zarkadas <[email protected]>
Signed-off-by: Yannis Zarkadas <[email protected]>
a46cf71
to
ac7a6ad
Compare
Signed-off-by: Yannis Zarkadas <[email protected]>
ac7a6ad
to
e48e130
Compare
apyrgio
pushed a commit
that referenced
this pull request
Jul 13, 2020
The `UserInfo` function of the `go-oidc` library doesn't expose details about the HTTP response from the OIDC Provider, if the request fails. This makes it impossible to detect if the returned code is `401`, in which case the user's session at the AuthService should be revoked. Initially, we were revoking the session on any error, but this caused undesired revocations because of errors we hadn't thought of (context cancellation). Reimplement the call to UserInfo and expose HTTP response details to the caller, so they can make a sensible decision. Github-PR: #31 Signed-off-by: Yannis Zarkadas <[email protected]> Reviewed-by: Alex Pyrgiotis <[email protected]>
apyrgio
pushed a commit
that referenced
this pull request
Jul 13, 2020
Having multiple kubeconfig files confuses k3d, which doesn't know what kubeconfig file to use. Instruct it to always use the `$HOME/.kube/config` file. Github-PR: #31 Signed-off-by: Yannis Zarkadas <[email protected]> Reviewed-by: Alex Pyrgiotis <[email protected]>
apyrgio
pushed a commit
that referenced
this pull request
Jul 13, 2020
Add a unit test for the UserInfo function to make sure that we can get back the request info when an error occurs. Github-PR: #31 Signed-off-by: Yannis Zarkadas <[email protected]> Reviewed-by: Alex Pyrgiotis <[email protected]>
apyrgio
pushed a commit
that referenced
this pull request
Jul 13, 2020
Github-PR: #31 Signed-off-by: Yannis Zarkadas <[email protected]> Reviewed-by: Alex Pyrgiotis <[email protected]>
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.
The
UserInfo
function of thego-oidc
library doesn't expose detailsabout the HTTP response from the OIDC Provider, if the request fails.
This makes it impossible to detect if the returned code is
401
, inwhich case the user's session at the AuthService should be revoked.
Initially, we were revoking the session on any error, but this caused
undesired revocations because of errors we hadn't thought of (context
cancellation).
Reimplement the call to UserInfo and expose HTTP response details to the
caller, so they can make a sensible decision.
Related: coreos/go-oidc#248