Skip to content

Commit

Permalink
ron: adding optional query params for PKCE flow
Browse files Browse the repository at this point in the history
  • Loading branch information
rarevalo13 committed Jan 27, 2025
1 parent 2f78b3d commit f6a89fb
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions pkg/usermanagement/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,11 @@ type AuthenticateWithPasswordOpts struct {
}

type AuthenticateWithCodeOpts struct {
ClientID string `json:"client_id"`
Code string `json:"code"`
IPAddress string `json:"ip_address,omitempty"`
UserAgent string `json:"user_agent,omitempty"`
ClientID string `json:"client_id"`
Code string `json:"code"`
CodeVerifier string `json:"code_verifier,omitempty"`
IPAddress string `json:"ip_address,omitempty"`
UserAgent string `json:"user_agent,omitempty"`
}

type AuthenticateWithRefreshTokenOpts struct {
Expand Down Expand Up @@ -836,7 +837,10 @@ type GetAuthorizationURLOpts struct {
//
// REQUIRED.
ClientID string

//Optional Used for PKCE
CodeChallenge string
//Optional Used for PKCE
CodeChallengeMethod string
// The callback URL where your app redirects the user after an
// authorization code is granted (eg. https://foo.com/callback).
//
Expand Down Expand Up @@ -896,6 +900,12 @@ func (c *Client) GetAuthorizationURL(opts GetAuthorizationURLOpts) (*url.URL, er
if opts.ConnectionID != "" {
query.Set("connection_id", opts.ConnectionID)
}
if opts.CodeChallenge != "" {
query.Set("code_challenge", opts.CodeChallenge)
}
if opts.CodeChallengeMethod != "" {
query.Set("code_challenge_method", opts.CodeChallengeMethod)
}
if opts.OrganizationID != "" {
query.Set("organization_id", opts.OrganizationID)
}
Expand Down

0 comments on commit f6a89fb

Please sign in to comment.