Pass resource parameter in login url

This commit is contained in:
Alexander Block 2020-07-13 14:24:04 +02:00
parent e9aa7acf4e
commit 8cbf9219bc

View File

@ -90,6 +90,9 @@ func (p *ProviderData) GetLoginURL(redirectURI, state string) string {
params.Set("client_id", p.ClientID)
params.Set("response_type", "code")
params.Add("state", state)
if p.ProtectedResource != nil && p.ProtectedResource.String() != "" {
params.Add("resource", p.ProtectedResource.String())
}
a.RawQuery = params.Encode()
return a.String()
}