This commit is contained in:
Livio Amstutz 2021-09-27 11:57:14 +02:00
parent b60f1ed7a8
commit 251c476e17
4 changed files with 23 additions and 21 deletions

View file

@ -170,17 +170,18 @@ func NewRelyingPartyOIDC(issuer, clientID, clientSecret, redirectURI string, sco
return nil, err
}
}
endpoints, err := Discover(rp.issuer, rp.httpClient)
config, err := client.Discover(rp.issuer, rp.httpClient)
if err != nil {
return nil, err
}
endpoints := GetEndpoints(config)
rp.oauthConfig.Endpoint = endpoints.Endpoint
rp.endpoints = endpoints
return rp, nil
}
//DefaultRPOpts is the type for providing dynamic options to the DefaultRP
//Option is the type for providing dynamic options to the relyingParty
type Option func(*relyingParty) error
//WithCookieHandler set a `CookieHandler` for securing the various redirects