Skip to content

Commit 92e27e1

Browse files
authored
Add comment for ContainsRedirectURI about the exact match (#30457)
Close #26897 Replace #30336
1 parent c28bed2 commit 92e27e1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

models/auth/oauth2.go

+5
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ func (app *OAuth2Application) TableName() string {
137137

138138
// ContainsRedirectURI checks if redirectURI is allowed for app
139139
func (app *OAuth2Application) ContainsRedirectURI(redirectURI string) bool {
140+
// OAuth2 requires the redirect URI to be an exact match, no dynamic parts are allowed.
141+
// https://stackoverflow.com/questions/55524480/should-dynamic-query-parameters-be-present-in-the-redirection-uri-for-an-oauth2
142+
// https://www.rfc-editor.org/rfc/rfc6819#section-5.2.3.3
143+
// https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
144+
// https://datatracker.ietf.org/doc/html/draft-ietf-oauth-security-topics-12#section-3.1
140145
contains := func(s string) bool {
141146
s = strings.TrimSuffix(strings.ToLower(s), "/")
142147
for _, u := range app.RedirectURIs {

0 commit comments

Comments
 (0)