mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-05-14 16:20:14 +00:00
fix: oidc open redirect (#854)
This commit is contained in:
@@ -297,6 +297,11 @@ func (service *OIDCService) ValidateAuthorizeParams(req AuthorizeRequest) error
|
|||||||
return errors.New("access_denied")
|
return errors.New("access_denied")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Redirect URI to verify that it's trusted
|
||||||
|
if !slices.Contains(client.TrustedRedirectURIs, req.RedirectURI) {
|
||||||
|
return errors.New("invalid_request_uri")
|
||||||
|
}
|
||||||
|
|
||||||
// Scopes
|
// Scopes
|
||||||
scopes := strings.Split(req.Scope, " ")
|
scopes := strings.Split(req.Scope, " ")
|
||||||
|
|
||||||
@@ -318,11 +323,6 @@ func (service *OIDCService) ValidateAuthorizeParams(req AuthorizeRequest) error
|
|||||||
return errors.New("unsupported_response_type")
|
return errors.New("unsupported_response_type")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redirect URI
|
|
||||||
if !slices.Contains(client.TrustedRedirectURIs, req.RedirectURI) {
|
|
||||||
return errors.New("invalid_request_uri")
|
|
||||||
}
|
|
||||||
|
|
||||||
// PKCE code challenge method if set
|
// PKCE code challenge method if set
|
||||||
if req.CodeChallenge != "" && req.CodeChallengeMethod != "" {
|
if req.CodeChallenge != "" && req.CodeChallengeMethod != "" {
|
||||||
if req.CodeChallengeMethod != "S256" && req.CodeChallengeMethod != "plain" {
|
if req.CodeChallengeMethod != "S256" && req.CodeChallengeMethod != "plain" {
|
||||||
|
|||||||
Reference in New Issue
Block a user