-
Notifications
You must be signed in to change notification settings - Fork 976
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: handle 'prompt' upstream parameter during OIDC flow
- Loading branch information
1 parent
5535fcb
commit 8e54caf
Showing
6 changed files
with
11 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -485,6 +485,7 @@ func TestSettingsStrategy(t *testing.T) { | |
values.Set("link", provider) | ||
values.Set("upstream_parameters.login_hint", "[email protected]") | ||
values.Set("upstream_parameters.hd", "bar.com") | ||
values.Set("upstream_parameters.prompt", "consent") | ||
|
||
resp, err := c.PostForm(action(req), *values) | ||
require.NoError(t, err) | ||
|
@@ -495,6 +496,7 @@ func TestSettingsStrategy(t *testing.T) { | |
|
||
require.EqualValues(t, "[email protected]", loc.Query().Get("login_hint")) | ||
require.EqualValues(t, "bar.com", loc.Query().Get("hd")) | ||
require.EqualValues(t, "consent", loc.Query().Get("prompt")) | ||
}) | ||
|
||
t.Run("case=invalid query parameters should be ignored", func(t *testing.T) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -671,6 +671,7 @@ func TestStrategy(t *testing.T) { | |
fv.Set("provider", "valid") | ||
fv.Set("upstream_parameters.login_hint", "[email protected]") | ||
fv.Set("upstream_parameters.hd", "ory.sh") | ||
fv.Set("upstream_parameters.prompt", "select_account") | ||
|
||
res, err := c.PostForm(action, fv) | ||
require.NoError(t, err) | ||
|
@@ -681,6 +682,7 @@ func TestStrategy(t *testing.T) { | |
|
||
require.Equal(t, "[email protected]", loc.Query().Get("login_hint")) | ||
require.Equal(t, "ory.sh", loc.Query().Get("hd")) | ||
require.Equal(t, "select_account", loc.Query().Get("prompt")) | ||
}) | ||
|
||
t.Run("case=should pass when logging in", func(t *testing.T) { | ||
|
@@ -693,6 +695,7 @@ func TestStrategy(t *testing.T) { | |
fv.Set("provider", "valid") | ||
fv.Set("upstream_parameters.login_hint", "[email protected]") | ||
fv.Set("upstream_parameters.hd", "ory.sh") | ||
fv.Set("upstream_parameters.prompt", "select_account") | ||
|
||
res, err := c.PostForm(action, fv) | ||
require.NoError(t, err) | ||
|
@@ -703,6 +706,7 @@ func TestStrategy(t *testing.T) { | |
|
||
require.Equal(t, "[email protected]", loc.Query().Get("login_hint")) | ||
require.Equal(t, "ory.sh", loc.Query().Get("hd")) | ||
require.Equal(t, "select_account", loc.Query().Get("prompt")) | ||
}) | ||
|
||
t.Run("case=should ignore invalid parameters when logging in", func(t *testing.T) { | ||
|