swagger-api / swagger-api/swagger-ui

Feature request: add `additionalFormParams` to `authConfigs`

Open
#5,399 23 comments 27 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

In oauth2-authorize.js the additionalQueryStringParams property is used from the authConfigs object in order to add custom query string parameters to an authentication request.

Could we get a similar additionalFormParams property added that could then be passed to the authActions via method params or a property? That would allow actions.js to add custom form properties as it's building the form data string.

Reason:
We're trying to use Swagger-UI (via Swashbuckle.AspNetCore) to authenticate with Auth0. It has the right mix of params for the implicit grant type, but we're finding that client_credentials and password out-of-the-box body params passed aren't meeting Auth0's requirements. For example: when trying to use client_credentials, Auth0 requires audience in the body, but swagger-ui only passes grant_type and scope. Adding audience to the query string params doesn't cut it. This is where people are talking about getting the "Non-global clients are not allowed access to APIv1" error from Auth0.

If we had a similar way to add custom form/body params like we do query string params, it would make life easier.

Cross-post side note: ideally the Swashbuckle.AspNetCore library could then add another extension method similar to OAuthAdditionalQueryStringParams that would feed those values through in a similar way.

Auth0 Reference:

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 in src/core/oauth2-authorize.js, where additionalQueryStringParams is read, and trace how authConfigs reaches the auth actions in src/core/plugins/auth/actions.js. Check how the form data string is built and define the completed behavior as custom additionalFormParams being passed through and included in the authentication request body.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, authentication
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.