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

fix: add CLI client IDs to default OIDC allowed audiences (#12170) #12179

Merged
merged 5 commits into from
Jan 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions util/oidc/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ func (p *providerImpl) Verify(tokenString string, argoSettings *settings.ArgoCDS
// Token must be verified for at least one allowed audience
for _, aud := range allowedAudiences {
idToken, err = p.verify(aud, tokenString, false)
tokenExpiredError := &gooidc.TokenExpiredError{}
if errors.As(err, &tokenExpiredError) {
leoluz marked this conversation as resolved.
Show resolved Hide resolved
// If the token is expired, we won't bother checking other audiences. It's important to return a
// TokenExpiredError instead of an error related to an incorrect audience, because the caller may
// have specific behavior to handle expired tokens.
break
}
if err == nil {
break
}
Expand Down