mirror of
https://github.com/zitadel/zitadel.git
synced 2025-06-12 20:28:33 +00:00
fix: reduce origin check to tokens issued through code and implicit flow (#6681)
fix: only check origin for tokens issued to users through apps (code / implicit flow)
This commit is contained in:
parent
54676eda98
commit
9696fde676
@ -78,9 +78,12 @@ func VerifyTokenAndCreateCtxData(ctx context.Context, token, orgID, orgDomain st
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return CtxData{}, errors.ThrowPermissionDenied(err, "AUTH-GHpw2", "could not read projectid by clientid")
|
return CtxData{}, errors.ThrowPermissionDenied(err, "AUTH-GHpw2", "could not read projectid by clientid")
|
||||||
}
|
}
|
||||||
}
|
// We used to check origins for every token, but service users shouldn't be used publicly (native app / SPA).
|
||||||
if err := checkOrigin(ctx, origins); err != nil {
|
// Therefore, mostly won't send an origin and aren't able to configure them anyway.
|
||||||
return CtxData{}, err
|
// For the current time we will only check origins for tokens issued to users through apps (code / implicit flow).
|
||||||
|
if err := checkOrigin(ctx, origins); err != nil {
|
||||||
|
return CtxData{}, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if orgID == "" && orgDomain == "" {
|
if orgID == "" && orgDomain == "" {
|
||||||
orgID = resourceOwner
|
orgID = resourceOwner
|
||||||
|
Loading…
x
Reference in New Issue
Block a user