Skip to content

Commit

Permalink
cmd: Adds jwt strategy and fixes nil pointer exception
Browse files Browse the repository at this point in the history
  • Loading branch information
arekkas committed May 20, 2018
1 parent 7675144 commit f93ae43
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/server/handler_oauth2_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,14 @@ func newOAuth2Provider(c *config.Config) (fosite.OAuth2Provider, string) {
EnablePKCEPlainChallengeMethod: false,
}

jwtStrategy := compose.NewOpenIDConnectStrategy(jwk.MustRSAPrivate(privateKey))
return compose.Compose(
fc,
store,
&compose.CommonStrategy{
CoreStrategy: compose.NewOAuth2HMACStrategy(fc, c.GetSystemSecret()),
OpenIDConnectTokenStrategy: compose.NewOpenIDConnectStrategy(jwk.MustRSAPrivate(privateKey)),
OpenIDConnectTokenStrategy: jwtStrategy,
JWTStrategy: jwtStrategy,
},
nil,
compose.OAuth2AuthorizeExplicitFactory,
Expand Down

0 comments on commit f93ae43

Please sign in to comment.