Skip to content

Commit

Permalink
uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
alldoami committed Dec 17, 2024
1 parent 867c81c commit 7ae2a99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions oidc_cli/oidc_impl/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (c *Client) idTokenFromOauth2Token(

// RefreshToken will fetch a new token
func (c *Client) RefreshToken(ctx context.Context, oldToken *Token) (*Token, error) {
logrus.Debugf("refresh scopes: %#v", c.oauthConfig.Scopes)
logrus.Debugf("refresh scopes: %#v", c.OauthConfig.Scopes)

newToken, err := c.refreshToken(ctx, oldToken)
// if we could refresh successfully, do so.
Expand All @@ -130,7 +130,7 @@ func (c *Client) refreshToken(ctx context.Context, token *Token) (*Token, error)
Expiry: token.Expiry,
}

tokenSource := c.oauthConfig.TokenSource(ctx, oauthToken)
tokenSource := c.OauthConfig.TokenSource(ctx, oauthToken)

newOauth2Token, err := tokenSource.Token()
if err != nil {
Expand Down Expand Up @@ -163,7 +163,7 @@ func (c *Client) refreshToken(ctx context.Context, token *Token) (*Token, error)

// GetAuthCodeURL gets the url to the oauth2 consent page
func (c *Client) GetAuthCodeURL(oauthMaterial *oauthMaterial) string {
return c.oauthConfig.AuthCodeURL(
return c.OauthConfig.AuthCodeURL(
oauthMaterial.State,
oauth2.SetAuthURLParam("grant_type", "refresh_token"),
oauth2.SetAuthURLParam("code_challenge", oauthMaterial.CodeChallenge),
Expand All @@ -182,12 +182,12 @@ func (c *Client) ValidateState(ourState []byte, otherState []byte) error {

// Exchange will exchange a token
func (c *Client) Exchange(ctx context.Context, code string, codeVerifier string) (*oauth2.Token, error) {
token, err := c.oauthConfig.Exchange(
token, err := c.OauthConfig.Exchange(
ctx,
code,
oauth2.SetAuthURLParam("grant_type", "authorization_code"),
oauth2.SetAuthURLParam("code_verifier", codeVerifier),
oauth2.SetAuthURLParam("client_id", c.oauthConfig.ClientID),
oauth2.SetAuthURLParam("client_id", c.OauthConfig.ClientID),
)
return token, errors.Wrap(err, "failed to exchange oauth token")
}
Expand Down
2 changes: 1 addition & 1 deletion oidc_cli/oidc_impl/client/config_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ var SetSuccessMessage = func(successMessage string) Option {

var SetOauth2AuthStyle = func(authStyle oauth2.AuthStyle) Option {
return func(c *Client) {
c.oauthConfig.Endpoint.AuthStyle = authStyle
c.OauthConfig.Endpoint.AuthStyle = authStyle
}
}

0 comments on commit 7ae2a99

Please sign in to comment.