Authentication - OAuth2
OAuth 2.0 Authentication
Purpose:
OAuth 2.0 is used to confirm the identity of the user making the request. This ensures that only authenticated users can access resources.
How it Works:
Get your Oauth2 credentials:
Obtain an Access Token:
Your client application initiates the OAuth 2.0 flow (client credentials grant) with the authorization server. See below examples on how to generate a token using command line or Postman.
Upon successful authentication, the authorization server issues an access token.
Include the Token in the Authorization Header:
- The client application includes the access token in the
Authorizationheader of each API request, formatted asBearer.
- The client application includes the access token in the
Example of request including the Auth token in the Authorization header:
Examples of Token generation
How to create token with CURL in command line
Example of generating a token for Staging:
How to create token using Postman
Configure OAuth 2.0:
Go to the "Authorization" tab in Postman.
Select "OAuth 2.0" from the "Type" dropdown.
Configure the OAuth 2.0 settings according to your API's requirements:
Grant Type: Select the appropriate grant type. choose Client Credentials.
Access Token URL: The URL to exchange the authorization code for an access token.
Client ID: Your client application's ID .
Client Secret: Your client application's secret.
Scope: add needed scopes. Example "smartdocflow/read smartdocflow/write".
Click "Get New Access Token" to obtain a valid access token.
If the request is successful, a new token is created. click use token to start using it.
- Postman will then automatically add the
Authorization: Bearerheader to your requests (where Bearer is your token value).
- Postman will then automatically add the