From 6cfd02e4c9058ee1c7ee1f50f42d77deb12016f3 Mon Sep 17 00:00:00 2001 From: Fabi <38692350+fgerschwiler@users.noreply.github.com> Date: Mon, 21 Sep 2020 15:11:42 +0200 Subject: [PATCH] feat: prompt option (#59) * feat: prompt option * Update pkg/rp/relaying_party.go Co-authored-by: Livio Amstutz Co-authored-by: Livio Amstutz --- 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 109a3ef6..3fe8b4bb 100644 --- a/pkg/rp/relaying_party.go +++ b/pkg/rp/relaying_party.go @@ -401,6 +401,15 @@ func WithCodeChallenge(codeChallenge string) AuthURLOpt { } } +//WithPrompt sets the `prompt` params in the auth request +func WithPrompt(prompt oidc.Prompt) AuthURLOpt { + return func() []oauth2.AuthCodeOption { + return []oauth2.AuthCodeOption{ + oauth2.SetAuthURLParam("prompt", string(prompt)), + } + } +} + type CodeExchangeOpt func() []oauth2.AuthCodeOption //WithCodeVerifier sets the `code_verifier` param in the token request