-
Notifications
You must be signed in to change notification settings - Fork 821
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
feat: OIDC authentication support #4427
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Ivar Cmrecak <ivar.cmrecak@lego.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@var-i Thanks for contributions! As this PR is implemented based on the GCP authentication, there are some areas that could be further refined and I will continue to give comments.
"golang.org/x/oauth2" | ||
) | ||
|
||
func setCookie(c *gin.Context, token *oauth2.Token) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setCookie
has already been defined in gcp
package, it's better to extract a public method instead of making a copy of it.
ctx := c.Request.Context() | ||
|
||
s.logger.Info("handling oidc middleware") | ||
if c.Request.Header.Get("X-Authorization-Method") != "gcp" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part of the code should be updated. We can use oidc
as the X-Authorization-Method
. At the same time, we also need to update the frontend to adapt it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we can use oauth
to unify all OAuth-based authorization.
What problem does this PR solve?
Close #4141
What's changed and how it works?
Adds frontend and backend support for Kubernetes OIDC authentication
Related changes
UI interface
Cherry-pick to release branches (optional)
Checklist
CHANGELOG
CHANGELOG.md
Tests
Side effects
DCO
If you find the DCO check fails, please run commands like below (Depends on the actual situations. For example, if the failed commit isn't the most recent) to fix it: