From ce9a8ecf3d13c142353b60a18956725263a8f7c6 Mon Sep 17 00:00:00 2001 From: Fabiennne Date: Mon, 21 Sep 2020 14:53:22 +0200 Subject: [PATCH 1/2] feat: prompt option --- pkg/rp/relaying_party.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/rp/relaying_party.go b/pkg/rp/relaying_party.go index 8aba443a..4634fbd8 100644 --- a/pkg/rp/relaying_party.go +++ b/pkg/rp/relaying_party.go @@ -98,6 +98,15 @@ func WithCodeChallenge(codeChallenge string) AuthURLOpt { } } +//WithPrompt sets the `prompt` params in the auth request +func WithPrompt(prompt string) AuthURLOpt { + return func() []oauth2.AuthCodeOption { + return []oauth2.AuthCodeOption{ + oauth2.SetAuthURLParam("prompt", prompt), + } + } +} + type CodeExchangeOpt func() []oauth2.AuthCodeOption //WithCodeVerifier sets the `code_verifier` param in the token request From 0479454f1f0f17017baa8f7ce39b5b58020edc2e Mon Sep 17 00:00:00 2001 From: Fabi <38692350+fgerschwiler@users.noreply.github.com> Date: Mon, 21 Sep 2020 15:06:13 +0200 Subject: [PATCH 2/2] Update pkg/rp/relaying_party.go Co-authored-by: Livio Amstutz --- pkg/rp/relaying_party.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/rp/relaying_party.go b/pkg/rp/relaying_party.go index 4634fbd8..77f7a088 100644 --- a/pkg/rp/relaying_party.go +++ b/pkg/rp/relaying_party.go @@ -99,10 +99,10 @@ func WithCodeChallenge(codeChallenge string) AuthURLOpt { } //WithPrompt sets the `prompt` params in the auth request -func WithPrompt(prompt string) AuthURLOpt { +func WithPrompt(prompt oidc.Prompt) AuthURLOpt { return func() []oauth2.AuthCodeOption { return []oauth2.AuthCodeOption{ - oauth2.SetAuthURLParam("prompt", prompt), + oauth2.SetAuthURLParam("prompt", string(prompt)), } } }