Skip to content

Commit

Permalink
feat: new factory with default issuer for JWT tokens (#444)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitar authored Jun 22, 2020
1 parent 17b0756 commit 901e206
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions compose/compose_strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ func NewOAuth2JWTStrategy(key *rsa.PrivateKey, strategy *oauth2.HMACSHAStrategy)
}
}

func NewOAuth2JWTStrategyWithIssuer(key *rsa.PrivateKey, strategy *oauth2.HMACSHAStrategy, issuer string) *oauth2.DefaultJWTStrategy {
return &oauth2.DefaultJWTStrategy{
JWTStrategy: &jwt.RS256JWTStrategy{
PrivateKey: key,
},
HMACSHAStrategy: strategy,
Issuer: issuer,
}
}

func NewOpenIDConnectStrategy(config *Config, key *rsa.PrivateKey) *openid.DefaultStrategy {
return &openid.DefaultStrategy{
JWTStrategy: &jwt.RS256JWTStrategy{
Expand Down

0 comments on commit 901e206

Please sign in to comment.