Skip to content

Latest commit

 

History

History
26 lines (23 loc) · 1.38 KB

oauth2.md

File metadata and controls

26 lines (23 loc) · 1.38 KB

OAuth2 configuration

You can configure OAuth2 authorization by calling the initOAuth method.

Config Name Description
client_id Default clientId. MUST be a string
client_secret Default clientSecret. MUST be a string
realm realm query parameter (for oauth1) added to authorizationUrl and tokenUrl . MUST be a string
appName application name, displayed in authorization popup. MUST be a string
scopeSeparator scope separator for passing scopes, encoded before calling, default value is a space (encoded value %20). MUST be a string
additionalQueryStringParams Additional query parameters added to authorizationUrl and tokenUrl. MUST be an object
useBasicAuthenticationWithAccessCodeGrant Only activated for the accessCode flow. During the authorization_code request to the tokenUrl, pass the Client Password using the HTTP Basic Authentication scheme (Authorization header with Basic base64encode(client_id + client_secret)). The default is false
const ui = SwaggerUI({...})

// Method can be called in any place after calling constructor SwaggerUIBundle
ui.initOAuth({
    clientId: "your-client-id",
    clientSecret: "your-client-secret-if-required",
    realm: "your-realms",
    appName: "your-app-name",
    scopeSeparator: " ",
    additionalQueryStringParams: {test: "hello"}
  })