Skip to content

Commit

Permalink
feat: Make non public client authenticate with secret in basic
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag committed Aug 4, 2022
1 parent cda8889 commit 1e9c25e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,18 @@ func (c *Client) Update(opts ClientOptions) {
if !opts.Public {
grantTypes = append(grantTypes, oidc.GrantTypeClientCredentials)
}
authMethod := oidc.AuthMethodNone
if !opts.Public {
authMethod = oidc.AuthMethodBasic
}

c.GrantTypes = grantTypes
c.RedirectURIs = opts.RedirectUris
c.PostLogoutRedirectUris = opts.PostLogoutRedirectUris
c.Description = opts.Description
c.Name = opts.Name
c.Metadata = opts.Metadata
c.AuthMethod = authMethod
}

func (c *Client) GenerateNewSecret(name string) (ClientSecret, string) {
Expand Down Expand Up @@ -127,7 +132,6 @@ func NewClient(opts ClientOptions) *Client {
client := &Client{
Id: uuid.NewString(),
ApplicationType: op.ApplicationTypeWeb,
AuthMethod: oidc.AuthMethodNone,
ResponseTypes: []oidc.ResponseType{oidc.ResponseTypeCode},
AccessTokenType: op.AccessTokenTypeJWT,
}
Expand Down

0 comments on commit 1e9c25e

Please sign in to comment.