You've already forked oauth2-proxy
mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-08-08 22:46:33 +02:00
feat: use non-default authorization request response mode in OIDC providers (#3055)
* fix: OIDC sets response mode * Update CHANGELOG
This commit is contained in:
@@ -275,3 +275,32 @@ func TestOIDCProviderCreateSessionFromToken(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestOIDCProviderResponseModeConfigured(t *testing.T) {
|
||||
providerData := &ProviderData{
|
||||
LoginURL: &url.URL{
|
||||
Scheme: "http",
|
||||
Host: "my.test.idp",
|
||||
Path: "/oauth/authorize",
|
||||
},
|
||||
AuthRequestResponseMode: "form_post",
|
||||
}
|
||||
p := NewOIDCProvider(providerData, options.OIDCOptions{})
|
||||
|
||||
result := p.GetLoginURL("https://my.test.app/oauth", "", "", url.Values{})
|
||||
assert.Contains(t, result, "response_mode=form_post")
|
||||
}
|
||||
|
||||
func TestOIDCProviderResponseModeNotConfigured(t *testing.T) {
|
||||
providerData := &ProviderData{
|
||||
LoginURL: &url.URL{
|
||||
Scheme: "http",
|
||||
Host: "my.test.idp",
|
||||
Path: "/oauth/authorize",
|
||||
},
|
||||
}
|
||||
p := NewOIDCProvider(providerData, options.OIDCOptions{})
|
||||
|
||||
result := p.GetLoginURL("https://my.test.app/oauth", "", "", url.Values{})
|
||||
assert.NotContains(t, result, "response_mode")
|
||||
}
|
||||
|
Reference in New Issue
Block a user