mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:27:42 +00:00
fix(authz): add logging to access token verification errors (#6976)
* fix(authz): add logging to access token verification errors Related to #6949 * use logging fields --------- Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
@@ -263,9 +263,11 @@ func (repo *TokenVerifierRepo) getTokenIDAndSubject(ctx context.Context, accessT
|
||||
// let's try opaque first:
|
||||
tokenIDSubject, err := repo.decryptAccessToken(accessToken)
|
||||
if err != nil {
|
||||
logging.WithError(err).Warn("token verifier repo: decrypt access token")
|
||||
// if decryption did not work, it might be a JWT
|
||||
accessTokenClaims, err := op.VerifyAccessToken[*oidc.AccessTokenClaims](ctx, accessToken, repo.jwtTokenVerifier(ctx))
|
||||
if err != nil {
|
||||
logging.WithError(err).Warn("token verifier repo: verify JWT access token")
|
||||
return "", "", false
|
||||
}
|
||||
return accessTokenClaims.JWTID, accessTokenClaims.Subject, true
|
||||
|
Reference in New Issue
Block a user