@@ -275,3 +275,32 @@ func TestOIDCProviderCreateSessionFromToken(t *testing.T) {
275275 })
276276 }
277277}
278+
279+func TestOIDCProviderResponseModeConfigured(t *testing.T) {
280+ providerData := &ProviderData{
281+ LoginURL: &url.URL{
282+ Scheme: "http",
283+ Host: "my.test.idp",
284+ Path: "/oauth/authorize",
285+ },
286+ AuthRequestResponseMode: "form_post",
287+ }
288+ p := NewOIDCProvider(providerData, options.OIDCOptions{})
289+
290+ result := p.GetLoginURL("https://my.test.app/oauth", "", "", url.Values{})
291+ assert.Contains(t, result, "response_mode=form_post")
292+}
293+
294+func TestOIDCProviderResponseModeNotConfigured(t *testing.T) {
295+ providerData := &ProviderData{
296+ LoginURL: &url.URL{
297+ Scheme: "http",
298+ Host: "my.test.idp",
299+ Path: "/oauth/authorize",
300+ },
301+ }
302+ p := NewOIDCProvider(providerData, options.OIDCOptions{})
303+
304+ result := p.GetLoginURL("https://my.test.app/oauth", "", "", url.Values{})
305+ assert.NotContains(t, result, "response_mode")
306+}