Skip to content

Commit

Permalink
feat: add access token strategy parameter to cli
Browse files Browse the repository at this point in the history
fixes #3717
  • Loading branch information
jagobagascon committed Feb 14, 2024
1 parent 33950db commit 790e4dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/cmd_create_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
)

const (
flagClientAccessTokenStrategy = "access-token-strategy"
flagClientAllowedCORSOrigin = "allowed-cors-origin"
flagClientAudience = "audience"
flagClientBackchannelLogoutCallback = "backchannel-logout-callback"
Expand Down
2 changes: 2 additions & 0 deletions cmd/cmd_helper_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (

func clientFromFlags(cmd *cobra.Command) hydra.OAuth2Client {
return hydra.OAuth2Client{
AccessTokenStrategy: pointerx.String(flagx.MustGetString(cmd, flagClientAccessTokenStrategy)),
AllowedCorsOrigins: flagx.MustGetStringSlice(cmd, flagClientAllowedCORSOrigin),
Audience: flagx.MustGetStringSlice(cmd, flagClientAudience),
BackchannelLogoutSessionRequired: pointerx.Bool(flagx.MustGetBool(cmd, flagClientBackChannelLogoutSessionRequired)),
Expand Down Expand Up @@ -81,6 +82,7 @@ func registerClientFlags(flags *pflag.FlagSet) {
flags.StringSlice(flagClientPostLogoutCallback, []string{}, "List of allowed URLs to be redirected to after a logout.")
flags.Bool(flagClientSkipConsent, false, "Boolean flag specifying whether to skip the consent screen for this client. If omitted, the default value is false.")
flags.Bool(flagClientLogoutSkipConsent, false, "Boolean flag specifying whether to skip the logout consent screen for this client. If omitted, the default value is false.")
flags.String(flagClientAccessTokenStrategy, "opaque", "The strategy used to generate access tokens. Valid options are `opaque` and `jwt`. If omitted, the default value is `opaque`.")

// back-channel logout options
flags.Bool(flagClientBackChannelLogoutSessionRequired, false, "Boolean flag specifying whether the client requires that a sid (session ID) Claim be included in the Logout Token to identify the client session with the OP when the backchannel-logout-callback is used. If omitted, the default value is false.")
Expand Down

0 comments on commit 790e4dc

Please sign in to comment.