mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-30 16:08:56 +00:00
fix: invalid jwt assertion error handling (#11933)
# Which Problems Are Solved Incorrectly mapped errors on the `/oauth/v2/token` endpoint lead to a large number of HTTP status 500 errors. # How the Problems Are Solved By mapping invalid jwt assertion errors to OIDC `invalid_client` errors, which returns a HTTP status 400. # Additional Changes N/A # Additional Context - Closes https://github.com/zitadel/zitadel/issues/11924 - Follow-up: - Fix the [error handling](https://github.com/zitadel/oidc/blob/main/pkg/oidc/verifier.go#L195) in the oidc package --------- Co-authored-by: Copilot <[email protected]>
This commit is contained in:
co-authored by
Copilot
parent
330548e13c
commit
5344a7f584
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v3/pkg/op"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/api/authz"
|
||||
"github.com/zitadel/zitadel/internal/crypto"
|
||||
"github.com/zitadel/zitadel/internal/domain"
|
||||
"github.com/zitadel/zitadel/internal/query"
|
||||
@@ -76,7 +77,7 @@ func (s *Server) verifyJWTProfile(ctx context.Context, req *oidc.JWTProfileGrant
|
||||
)
|
||||
_, err = op.VerifyJWTAssertion(ctx, req.Assertion, verifier)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, oidc.ErrInvalidGrant().WithParent(err).WithReturnParentToClient(authz.GetFeatures(ctx).DebugOIDCParentError).WithDescription("invalid assertion")
|
||||
}
|
||||
return storage.user, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user