mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-31 18:07:17 +02:00
support both stateful and stateless authenticate (#4765)
Update the initialization logic for the authenticate, authorize, and proxy services to automatically select between the stateful authentication flow and the stateless authentication flow, depending on whether Pomerium is configured to use the hosted authenticate service. Add a unit test case to verify that the sign_out handler does not trigger a sign in redirect.
This commit is contained in:
parent
b9c56074aa
commit
5ccd7a520a
7 changed files with 86 additions and 12 deletions
|
@ -856,6 +856,21 @@ func TestOptions_DefaultURL(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestOptions_UseStatelessAuthenticateFlow(t *testing.T) {
|
||||
t.Run("enabled by default", func(t *testing.T) {
|
||||
options := &Options{}
|
||||
assert.True(t, options.UseStatelessAuthenticateFlow())
|
||||
})
|
||||
t.Run("enabled explicitly", func(t *testing.T) {
|
||||
options := &Options{AuthenticateURLString: "https://authenticate.pomerium.app"}
|
||||
assert.True(t, options.UseStatelessAuthenticateFlow())
|
||||
})
|
||||
t.Run("disabled", func(t *testing.T) {
|
||||
options := &Options{AuthenticateURLString: "https://authenticate.example.com"}
|
||||
assert.False(t, options.UseStatelessAuthenticateFlow())
|
||||
})
|
||||
}
|
||||
|
||||
func TestOptions_GetOauthOptions(t *testing.T) {
|
||||
opts := &Options{AuthenticateURLString: "https://authenticate.example.com"}
|
||||
oauthOptions, err := opts.GetOauthOptions()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue