Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAuth 2.0 Client Credentials Not Working #294

Open
brozeph opened this issue Nov 20, 2024 · 1 comment
Open

OAuth 2.0 Client Credentials Not Working #294

brozeph opened this issue Nov 20, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@brozeph
Copy link

brozeph commented Nov 20, 2024

Version:

v0.29.0

Steps to reproduce:

  • Create new request
  • Click on Auth tab in request and select "OAuth 2.0"
  • Fill in appropriate Client ID, Client Secret, Access Token URL and select "Client Credentials" for Grant Type
  • Click "Get Token"

Expected Results:

Access Token should be populated

Actual Results:

Error in logs:

12:00:35:774 - [ERROR] - Error fetching OAuth token: { "status": 403, "statusText": "", "headers": [ [ "access-control-allow-origin", "*" ], [ "alt-svc", "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" ], [ "cache-control", "no-cache" ], [ "content-length", "134" ], [ "content-security-policy", "trusted-types 'none'; require-sri-for script style; report-to 'none'; report-uri 'none'; navigate-to 'none'; sandbox 'none'; child-src 'none'; default-src 'none'; frame-ancestors 'none'; script-src 'none'; script-src-elem 'none'; script-src-attr 'none'; style-src 'none'; style-src-elem 'none'; style-src-attr 'none'; img-src 'none'; connect-src 'none'; frame-src 'none'; font-src 'none'; media-src 'none'; base-uri 'none'; object-src 'none'; manifest-src 'none'; worker-src 'none'; prefetch-src 'none'; form-action 'none'; upgrade-insecure-requests" ], [ "content-type", "text/html; charset=UTF-8" ], [ "date", "Wed, 20 Nov 2024 20:00:35 GMT" ], [ "expires", "Mon, 01 Jan 1990 00:00:00 GMT" ], [ "permissions-policy", "geolocation 'self';" ], [ "pragma", "no-cache" ], [ "referrer-policy", "no-referrer" ], [ "server", "unknown" ], [ "strict-transport-security", "max-age='31536000'; includeSubDomains; preload" ], [ "x-content-type-options", "nosniff" ], [ "x-frame-options", "deny" ], [ "x-permitted-cross-domain-policies", "none" ], [ "x-xss-protection", "1; 'mode=block'" ] ], "mimeType": "text/html;charset=utf-8", "timeTaken": 231, "headTimeTaken": 231, "bodyTimeTaken": 0, "body": "<!doctype html><meta charset=\"utf-8\"><meta name=viewport content=\"width=device-width, initial-scale=1\"><title>403</title>403 Forbidden" }

It appears the Authorization header is not being sent... for example:

curl -XPOST -H"Authorization: Basic <base64 encoded value of clientID:clientSecret>" -d"grant_type=client_credentials" <access token URL>
@flawiddsouza flawiddsouza added the bug Something isn't working label Nov 21, 2024
@flawiddsouza
Copy link
Owner

We have an oauth2 testing server at https://github.com/flawiddsouza/Restfox/tree/main/packages/test-api-oauth2.

It seems this is a different way of getting the token:

-H"Authorization: Basic <base64 encoded value of clientID:clientSecret>"

Currently we have only 1:
image
We need to support 2 as well.

I will look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants