Testing OAuth2 Authorization Code Flow with Postman
Designer Configuration for OAuth2 Authentication Provider
Step 1: Define a New Authentication Provider Alias
- Set up a new authentication provider by defining an alias.
Step 2: Configure OAuth2 Credentials
- Configure the authentication provider with the OAuth2 credentials of your application.
Figure: OAuth2 Authentication Provider Properties
Step 3: Configure Login Entry in Client Configuration
- Configure a login entry in
configuration > client > loginList
of your BG service.
Ensure the propertyalias
is set to your generated alias.
Figure: Login List Configuration
Step 4: Ensure User Recognition via OAuth2 Login
- Ensure that users accessing the web service can be recognized by their OAuth2 login (typically their email address).
This requires setting upsecuritySSOUserTemplate
or OAuth2 login for each user, or using the email address as the username.
Step 5: Assign Required Role to Users
- Verify that users accessing the web service have the role
INTERNAL_WEBSERVICE
.
Step 6: Configure Webservice Login Type
- Set up a webservice to use the name of the
loginList
configuration as theloginTypeId
.
Example Configuration and Testing Using Microsoft Entra and Postman
Microsoft Entra Application Setup
- Create a new Microsoft Entra application.
- Collect the
clientID
andtenantId
. - Create a new client secret.
- Add Postman’s web redirect URI:
https://oauth.pstmn.io/v1/browser-callback
. - Add your users to the application.
Figure: Microsoft Entra Application Overview
Figure: Application Client Secret Configuration
Figure: Redirect URI Configuration
Figure: User Assignment to Application
Postman Configuration and Token Retrieval
tip
Use the web version of Postman to enable the Authorization Code Flow functionality.
- Create a new REST request targeting the ADITO webservice.
- Configure OAuth 2.0 as the authorization method.
- Enter your OAuth2 provider details and credentials.
- Request an access token using the Authorization Code Flow.
- Use the obtained token to call the ADITO webservice.
Figure: Postman OAuth 2.0 Authorization Setup
Figure: Postman Token Request and Usage
Additional Information
Microsoft Entra OAuth2 Endpoints and Scope
- Authorization URL and Access Token URL as configured in Microsoft Entra:
Figure: Microsoft Entra OAuth2 Endpoint Configuration
- Use the scope format:
ClientID/.default