fix(oidc): accept localhost redirect URIs without path nor port (#10836)

# Which Problems Are Solved

Some native OIDC applications use localhost without a path as redirect
URI. Currently, setting `http://localhost` as a redirect URI leads to a
compliance warning (`Redirect URIs must begin with your own protocol,
http://127.0.0.1, http://[::1] or http://localhost.`), while
`http://localhost/some/path` and `http://localhost:some-port` are
accepted).

# How the Problems Are Solved

This PR adds additional checks to accept `http://localhost`,
`http://127.0.0.1`, `http://[::1]` and `http://[0:0:0:0:0:0:0:1]` (their
counterpart with port and with path were already accepted).

---------

Co-authored-by: Marco Ardizzone <[email protected]>
This commit is contained in:
Yann Soubeyrand
2025-10-21 10:10:49 +00:00
committed by GitHub
co-authored by Marco Ardizzone
parent ebc6c503a3
commit 88213d785a
2 changed files with 42 additions and 28 deletions
+1 -1
View File
@@ -489,7 +489,7 @@ func TestCheckRedirectUrisImplicit(t *testing.T) {
{
name: "only http protocol, app type native, only localhost",
args: args{
redirectUris: []string{"http://localhost:8080"},
redirectUris: []string{"http://localhost:8080", "http://localhost/", "http://localhost"},
appType: gu.Ptr(OIDCApplicationTypeNative),
},
want: &Compliance{