@@ -47,3 +47,21 @@ func TestAcrValuesConfigured(t *testing.T) {
4747 result := p.GetLoginURL("https://my.test.app/oauth", "")
4848 assert.Contains(t, result, "acr_values=testValue")
4949}
50+
51+func TestProtectedResourceConfigured(t *testing.T) {
52+ p := &ProviderData{
53+ LoginURL: &url.URL{
54+ Scheme: "http",
55+ Host: "my.test.idp",
56+ Path: "/oauth/authorize",
57+ },
58+ AcrValues: "testValue",
59+ ProtectedResource: &url.URL{
60+ Scheme: "http",
61+ Host: "my.resource.test",
62+ },
63+ }
64+
65+ result := p.GetLoginURL("https://my.test.app/oauth", "")
66+ assert.Contains(t, result, "resource="+url.QueryEscape("http://my.resource.test"))
67+}