mirror of
https://github.com/nais/wonderwall.git
synced 2026-05-09 18:06:42 +00:00
fix(openid/client): prompt parameter is optional
This commit is contained in:
@@ -176,6 +176,8 @@ func TestLogin_URL(t *testing.T) {
|
||||
assert.Contains(t, query, "ui_locales")
|
||||
assert.ElementsMatch(t, query["acr_values"], []string{openidConfig.Client().ACRValues()})
|
||||
assert.ElementsMatch(t, query["ui_locales"], []string{openidConfig.Client().UILocales()})
|
||||
assert.NotContains(t, query, "prompt")
|
||||
assert.NotContains(t, query, "max_age")
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -3,7 +3,8 @@ package openid
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"github.com/nais/wonderwall/pkg/openid/scopes"
|
||||
|
||||
"golang.org/x/oauth2"
|
||||
)
|
||||
@@ -49,7 +50,6 @@ func (a AuthorizationCodeParams) AuthParams() AuthParams {
|
||||
"code_challenge": oauth2.S256ChallengeFromVerifier(a.CodeVerifier),
|
||||
"code_challenge_method": "S256",
|
||||
"nonce": a.Nonce,
|
||||
"prompt": a.Prompt,
|
||||
"redirect_uri": a.RedirectURI,
|
||||
"response_mode": "query",
|
||||
"response_type": "code",
|
||||
@@ -66,6 +66,7 @@ func (a AuthorizationCodeParams) AuthParams() AuthParams {
|
||||
}
|
||||
|
||||
if len(a.Prompt) > 0 {
|
||||
params["prompt"] = a.Prompt
|
||||
params["max_age"] = "0"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user