選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

oauth2.md 2.0 KiB

12345678910111213141516171819202122232425262728
  1. # OAuth 2.0 configuration
  2. You can configure OAuth 2.0 authorization by calling the `initOAuth` method.
  3. Property name | Docker variable | Description
  4. --- | --- | ------
  5. clientId | `OAUTH_CLIENT_ID` | Default clientId. MUST be a string
  6. clientSecret | `OAUTH_CLIENT_SECRET` | **🚨 Never use this parameter in your production environment. It exposes cruicial security information. This feature is intended for dev/test environments only. 🚨** <br>Default clientSecret. MUST be a string
  7. realm | `OAUTH_REALM` |realm query parameter (for oauth1) added to `authorizationUrl` and `tokenUrl`. MUST be a string
  8. appName | `OAUTH_APP_NAME` |application name, displayed in authorization popup. MUST be a string
  9. scopeSeparator | `OAUTH_SCOPE_SEPARATOR` |scope separator for passing scopes, encoded before calling, default value is a space (encoded value `%20`). MUST be a string
  10. additionalQueryStringParams | `OAUTH_ADDITIONAL_PARAMS` |Additional query parameters added to `authorizationUrl` and `tokenUrl`. MUST be an object
  11. useBasicAuthenticationWithAccessCodeGrant | _Unavailable_ |Only activated for the `accessCode` flow. During the `authorization_code` request to the `tokenUrl`, pass the [Client Password](https://tools.ietf.org/html/rfc6749#section-2.3.1) using the HTTP Basic Authentication scheme (`Authorization` header with `Basic base64encode(client_id + client_secret)`). The default is `false`
  12. usePkceWithAuthorizationCodeGrant | `OAUTH_USE_PKCE` | Only applies to `authorizatonCode` flows. [Proof Key for Code Exchange](https://tools.ietf.org/html/rfc7636) brings enhanced security for OAuth public clients. The default is `false`
  13. ```javascript
  14. const ui = SwaggerUI({...})
  15. // Method can be called in any place after calling constructor SwaggerUIBundle
  16. ui.initOAuth({
  17. clientId: "your-client-id",
  18. clientSecret: "your-client-secret-if-required",
  19. realm: "your-realms",
  20. appName: "your-app-name",
  21. scopeSeparator: " ",
  22. additionalQueryStringParams: {test: "hello"},
  23. usePkceWithAuthorizationCodeGrant: true
  24. })
  25. ```