Update dependencies, fix compatibility with Hydra 1.10

This commit is contained in:
Jan Dittberner 2021-06-26 13:14:23 +02:00 committed by Jan Dittberner
parent 4d10c0e9c5
commit 8ebf81abe1
10 changed files with 318 additions and 134 deletions

View file

@ -101,8 +101,7 @@ func DiscoverOIDC(ctx context.Context, logger *log.Logger, params *OidcParams) (
Scopes: []string{"openid", "offline"},
}
ctx = context.WithValue(ctx, ctxOAuth2Config, oauth2Config)
keySet, err := jwk.FetchHTTP(discoveryResponse.JwksUri, jwk.WithHTTPClient(params.APIClient))
keySet, err := jwk.Fetch(ctx, discoveryResponse.JwksUri, jwk.WithHTTPClient(params.APIClient))
if err != nil {
log.Fatalf("could not fetch JWKs: %s", err)
}
@ -128,6 +127,6 @@ func GetOAuth2Config(ctx context.Context) *oauth2.Config {
// Get the JSON Web Key set from the context.
//
// DiscoverOIDC needs to be called before this is available.
func GetJwkSet(ctx context.Context) *jwk.Set {
return ctx.Value(ctxOidcJwks).(*jwk.Set)
func GetJwkSet(ctx context.Context) jwk.Set {
return ctx.Value(ctxOidcJwks).(jwk.Set)
}