Using Authentication Requests and OAuth
Table of Contents
This guide walks through how to use Outbound requests that require OAuth.
Please note your mileage may vary from the example below depending on the partner you are connecting to and their requirements.
Definitions
- Authentications – These are used to create an authentication name, assign authentication requests to authentication attributes (e.g. client id/secret), and tie to outbound requests.
- Authentication Requests - These requests make the authorization API call to generate/retrieve a token.
- Authentication Attributes - These attributes can be created and stored in one place but has values that are used throughout the system for a specific authentication.
Create Outbound requests that use OAuth
- Open the Authentication subsection under Requests in the left panel.
- Click + Create New Request.
- A new page will open. Enter in the Request Name and Request Description.
- Note: Think about building this as you would for an Outbound Request.
- Select POST as the request method.
- Enter the request endpoint.
- Note: Click the <…> button in order to view the Token Library.
- Set the Headers.
- Note: Note for application/x-www-form-urlencoded requests, be sure the header is set appropriately and choose XML for the payload type.
- Add the Payload.
- Map the Response to Paradox Attributes.
-
Notes:
- Map the
access_tokenvalue from the response to the<AuthName>.access_tokenattribute - Map the
expires_in valuefrom the response to the<AuthName>.expires_inattribute.- We take this value (in seconds) to set
[expiration of the auth token == (time of auth request) + expires_in].
- We take this value (in seconds) to set
- Map the
-
Notes:
- Click Save.
- Note: You also have the option to Save and Preview if you also want to view this request.
- Open the Authentications section from the left panel.
- Click the + Create New Authentication button.
- In the drawer that opens, enter the Authentication Name and Description.
- Add your authentication attributes/values.
- Add your newly-created Authentication Request to this Authentication.
- Click Save.
- Open the Requests section from the left panel.
- The Outbound Requests list will open by default. Click + Create New Request.
- Create your outbound request. As you create this request, ensure to complete the following:
- Select your new Authentication as your Authentication Type.
- Add your Authorization header to pass in the Bearer token.
- Click Save.
- Note: You also have the option to Save and Preview if you also want to view this request.
- Click the Run button within the new Outbound Request row.
- If the request's run time is greater than the expiration time on the authentication, the authentication will run the authentication request to generate a new access token and update the authentication attribute, then run the outbound request.
- If the request's runtime is less than expiration time on the authentication, the outbound request runs without calling the authentication request first, no need to generate a new access token.