drop unnecessary else
Co-authored-by: kobergj <jkoberg@owncloud.com> (cherry picked from commit a4b634cb67a42dd64528b32b55ea5483c40b5c8b)
This commit is contained in:
committed by
Jörn Friedrich Dreyer
parent
f0ac696f25
commit
341b5b4186
@@ -308,15 +308,14 @@ func (c *oidcClient) verifyAccessTokenJWT(token string) (RegClaimsWithSID, jwt.M
|
||||
return claims, mapClaims, err
|
||||
}
|
||||
|
||||
validIssuer := false
|
||||
issuer := c.issuer
|
||||
if c.provider.AccessTokenIssuer != "" {
|
||||
// AD FS .well-known/openid-configuration has an optional `access_token_issuer` which takes precedence over `issuer`
|
||||
// See https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-oidce/586de7dd-3385-47c7-93a2-935d9e90441c
|
||||
validIssuer = claims.VerifyIssuer(c.provider.AccessTokenIssuer, true)
|
||||
} else {
|
||||
validIssuer = claims.VerifyIssuer(c.issuer, true)
|
||||
issuer = c.provider.AccessTokenIssuer
|
||||
}
|
||||
if !validIssuer {
|
||||
|
||||
if !claims.VerifyIssuer(issuer, true) {
|
||||
vErr := jwt.ValidationError{}
|
||||
vErr.Inner = jwt.ErrTokenInvalidIssuer
|
||||
vErr.Errors |= jwt.ValidationErrorIssuer
|
||||
|
||||
Reference in New Issue
Block a user