feat: add possibility to add verifier opts to default RP
This commit is contained in:
parent
f645dd3543
commit
8f07a5b9c9
1 changed files with 10 additions and 3 deletions
|
@ -41,6 +41,7 @@ type DefaultRP struct {
|
||||||
errorHandler func(http.ResponseWriter, *http.Request, string, string, string)
|
errorHandler func(http.ResponseWriter, *http.Request, string, string, string)
|
||||||
|
|
||||||
verifier Verifier
|
verifier Verifier
|
||||||
|
verifierOpts []ConfFunc
|
||||||
onlyOAuth2 bool
|
onlyOAuth2 bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +80,7 @@ func NewDefaultRP(rpConfig *Config, rpOpts ...DefaultRPOpts) (DelegationTokenExc
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.verifier == nil {
|
if p.verifier == nil {
|
||||||
p.verifier = NewDefaultVerifier(rpConfig.Issuer, rpConfig.ClientID, NewRemoteKeySet(p.httpClient, p.endpoints.JKWsURL))
|
p.verifier = NewDefaultVerifier(rpConfig.Issuer, rpConfig.ClientID, NewRemoteKeySet(p.httpClient, p.endpoints.JKWsURL), p.verifierOpts...)
|
||||||
}
|
}
|
||||||
|
|
||||||
return p, nil
|
return p, nil
|
||||||
|
@ -112,6 +113,12 @@ func WithHTTPClient(client *http.Client) DefaultRPOpts {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func WithVerifierOpts(opts ...ConfFunc) DefaultRPOpts {
|
||||||
|
return func(p *DefaultRP) {
|
||||||
|
p.verifierOpts = opts
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//AuthURL is the `RelayingParty` interface implementation
|
//AuthURL is the `RelayingParty` interface implementation
|
||||||
//wrapping the oauth2 `AuthCodeURL`
|
//wrapping the oauth2 `AuthCodeURL`
|
||||||
//returning the url of the auth request
|
//returning the url of the auth request
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue