Using OAuth2 authentication with the Pega-provided Swagger UI
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.
- In the navigation pane of Dev Studio, click Records.
- Expand the Security category, and then click OAuth 2.0 Client Registration.
- Click on your client registration record to open it.
- 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.
- 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.
- Access your API. For more information, see Viewing application-specific REST APIs.
- On the API page, in the Service package field, select V2 DX API.
- Click Authorize, and then configure the fields according
to your grant type.
Grant type Actions Authorization code - In the AUTHCODE (OAUTH2, AUTHORIZATION CODE) section, enter the client ID and client secret from your OAuth 2.0 client registration record.
- Click Authorize.
Password credentials - In the PASSWORD (OAUTH2, PASSWORD) section, enter the username, password, client ID, and client secret.
- In the Type field, select Request body.
- Click Authorize.
Client credentials - In the CLIENTCREDENTIALS (OAUTH2, CLIENTCREDENTIALS) section, enter the client ID and client secret from your OAuth 2.0 client registration record.
- Click Authorize.
Previous topic Viewing application-specific REST APIs Next topic Creating a REST integration by using the Create REST integration wizard