Skip to content

Commit 460276a

Browse files
committed
sso_proxy: add additional test for ux flow
1 parent dd9e625 commit 460276a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

internal/proxy/oauthproxy_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,20 @@ func TestAuthenticationUXFlows(t *testing.T) {
837837
},
838838
ExpectStatusCode: http.StatusFound,
839839
},
840+
{
841+
Name: "authorized against different upstream, redirect to sign-in",
842+
SessionStore: &sessions.MockSessionStore{
843+
Session: &sessions.SessionState{
844+
845+
AuthorizedUpstream: "foo",
846+
AccessToken: "my_access_token",
847+
LifetimeDeadline: time.Now().Add(time.Duration(24) * time.Hour),
848+
RefreshDeadline: time.Now().Add(time.Duration(1) * time.Hour),
849+
ValidDeadline: time.Now().Add(time.Duration(1) * time.Minute),
850+
},
851+
},
852+
ExpectStatusCode: http.StatusFound,
853+
},
840854
}
841855
for _, tc := range testCases {
842856
t.Run(tc.Name, func(t *testing.T) {

0 commit comments

Comments
 (0)