mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-20 09:15:19 +01:00
Skip verifying OIDC token for local user
If a user does not have OIDC meta data in DB, it means he's not onboarded via OIDC authn, hence, we should not check the token. Signed-off-by: Daniel Jiang <jiangd@vmware.com>
This commit is contained in:
parent
239b33c5fb
commit
5292aea89e
@ -467,9 +467,12 @@ func (s *sessionReqCtxModifier) Modify(ctx *beegoctx.Context) bool {
|
||||
log.Errorf("Failed to get OIDC user info, error: %v", err)
|
||||
return false
|
||||
}
|
||||
if err := oidc.VerifyAndPersistToken(ctx.Request.Context(), ou); err != nil {
|
||||
log.Errorf("Failed to verify secret, error: %v", err)
|
||||
return false
|
||||
if ou != nil { // If user does not have OIDC metadata, it means he is not onboarded via OIDC authn,
|
||||
// so we can skip checking the token.
|
||||
if err := oidc.VerifyAndPersistToken(ctx.Request.Context(), ou); err != nil {
|
||||
log.Errorf("Failed to verify secret, error: %v", err)
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
log.Debug("using local database project manager")
|
||||
|
Loading…
Reference in New Issue
Block a user