swagger-api / swagger-api/swagger-ui

Supporting OKTA OAuth 2.0 Client Credentials Grant Flow

Open
#6,870 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Error description

I try to get an token from OKTA via swagger. I can only use the client_credentials flow. I am able to get a valid token when I do the request manually with curl.

When I am using swagger I get the following error:

auth errorError: Unauthorized, error: invalid_client, description: Browser requests to the token endpoint must use Proof Key for Code Exchange.

According to OKTA on https://support.okta.com/help/s/article/Browser-requests-to-the-token-endpoint-must-use-Proof-Key-for-Code-Exchange?language=en_US it is not allowed to send the origin header when a token is requested. Unfortunately the origin header is sent.

Do you have any workarounds?

Configuration

Swagger/OpenAPI definition: 3.0
Swashbuckle.AspNetCore 5.2.3

I also played with UsePkceWithAuthorizationCodeGrant and UseBasicAuthenticationWithAccessCodeGrant but that did not work.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Swagger UI OAuth 2.0 client_credentials request against an OKTA token endpoint, comparing the browser request with the working curl request. Inspect how Swagger UI sends the token request and determine whether the Origin header can be omitted or the flow otherwise supported; done means a documented or verified workaround for this configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, openapi
Domain
api, authentication, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.