Skip to content

Commit b0c753d

Browse files
authored
fix(auth): set AuthStyleInParams for OAuth2 (#11)
<!-- mesa-description-start --> ## TL;DR Fixes the OAuth2 authentication flow by sending client credentials in the request body, as required by the provider. ## Why we made these changes The upstream OAuth2 provider expects the `client_id` and `client_secret` to be in the request parameters during the token exchange. The previous configuration sent them in the `Authorization` header, causing authentication to fail. ## What changed? - Set `AuthStyle: oauth2.AuthStyleInParams` in the `oauth2.Config`. This forces the credentials into the request body, allowing the token exchange to succeed. <sup>_Description generated by Mesa. [Update settings](https://app.mesa.dev/onkernel/settings/pull-requests)_</sup> <!-- mesa-description-end -->
1 parent 191c318 commit b0c753d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/auth/oauth.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ func NewOAuthConfig() (*OAuthConfig, error) {
9191
RedirectURL: redirectURI,
9292
Scopes: strings.Split(DefaultScope, " "),
9393
Endpoint: oauth2.Endpoint{
94-
AuthURL: AuthURL,
95-
TokenURL: TokenURL,
94+
AuthURL: AuthURL,
95+
TokenURL: TokenURL,
96+
AuthStyle: oauth2.AuthStyleInParams,
9697
},
9798
}
9899

0 commit comments

Comments
 (0)