Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Using OAuth2 authentication with the Pega-provided Swagger UI

Updated on April 6, 2022

Authenticate with the Pega-provided Swagger UI so that you can test your Pega APIs, by creating an OAuth 2.0 client registration. Use the client ID and secret from your OAuth 2.0 client registration to define the scope of end-user access to the Swagger UI.

Before you begin: Create an OAuth 2.0 client registration record. For more information, see Creating and configuring an OAuth 2.0 client registration.
  1. In the navigation pane of Dev Studio, click Records.
  2. Expand the Security category, and then click OAuth 2.0 Client Registration.
  3. Click on your client registration record to open it.
  4. On the Client Information tab, if you select the Authorization code grant type in the Supported grant types section, add the following URL to use as a permitted redirect URI in the List of redirect URIs section: https://{Base_url}/prweb/PRRestService/SwaggerUIClient/v1/redirect.
    Note: Replace {Base_url} with the domain of the current system that you are using. To use the Swagger UI with your client registration record on other systems, such as QA or Production, add the same redirect URI in each system. Replace {Base_url} with the domain name of each of the other systems.
  5. On the Client Information tab, if you select the Client credentials grant type in the Supported grant types section, choose whether to set the context by using an operator ID or access group.
    • For client credentials with the operator scope, the client ID and secret is valid for all the applications that the user has access to.
    • For client credentials with the access group scope, the client ID and secret is valid only for the selected application that is linked to the access group.
    Tip: Ensure that you take note of the client ID and secret. You provide these values when you log in to the Swagger UI.
  6. Access your API. For more information, see Viewing application-specific REST APIs.
  7. On the API page, in the Service package field, select V2 DX API.
  8. Click Authorize, and then configure the fields according to your grant type.
    Grant typeActions
    Authorization code
    1. In the AUTHCODE (OAUTH2, AUTHORIZATION CODE) section, enter the client ID and client secret from your OAuth 2.0 client registration record.
    2. Click Authorize.
    Password credentials
    1. In the PASSWORD (OAUTH2, PASSWORD) section, enter the username, password, client ID, and client secret.
    2. In the Type field, select Request body.
    3. Click Authorize.
    Client credentials
    1. In the CLIENTCREDENTIALS (OAUTH2, CLIENTCREDENTIALS) section, enter the client ID and client secret from your OAuth 2.0 client registration record.
    2. Click Authorize.
    Result: The system authenticates your credentials, and you can now use the Swagger UI. If the system displays an error, review the following guidelines:
    • Confirm that you entered the correct client ID and secret. You can regenerate the secret by clicking Regenerate client secret in the client registration record.
    • Confirm that you saved your client registration record.
    • Ensure that you entered a valid operator ID or access group in the client registration record. Confirm that the operator or access group exists, and ensure that they are configured correctly.
    • Ensure that you entered the username and password correctly.
    • For Auth Code authentication, confirm that you configured the redirect URI that you want to use to authenticate with Swagger in your client registration record.

    For more information, see Creating and configuring an OAuth 2.0 client registration.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us