Auth requests
When syncing a Data Source, you may have the option to add extra configuration sections, such as an Auth Request (which can be used to call an authorization token), under the "Add a Section" drop down tab in the Connection Experience.
Example
The following example retrieves a bearer token in a REST API sync.
Parameter | Description | Example |
---|---|---|
HTTP Method | POST | |
Endpoint URL | The Cinchy endpoint used to retrieve the token. | https://{Cinchy SSO URL}/identity/connect/token |
Request Headers - Content Type - Name | Must be set to Content-Type | Content-Type |
Request Headers - Content Type - Header Value | Must be set to application/x-www-form-urlencoded | application/x-www-form-urlencoded |
Body | The body content used to retrieve the token. Review the parameters for this section here | client_id=<your client id>&client_secret=<your secret>&username=<your username>&password=<your password>&grant_type=password&scope=js_api |
Variables to Extract - Name | The name of your variable. | access_token |
Variables to Extract - Path in Response | The variable path. | $.access_token |
In the config file, it would appear like this:
<AuthRequest method="POST" endpoint="<your cinchy base url>/idp/identity/connect/token">
<RequestHeaders>
<Header tagNameIdentifier="Content-Type" name="Content-Type" isEncrypted="false">application/x-www-form-urlencoded</Header>
</RequestHeaders>
<Body>client_id=<your client id>&client_secret=<your secret>&username=<your username>&password=<your password>&grant_type=password&scope=js_api</Body>
<VariablesToExtract>
<Variable name="access_token" pathInResponse="$.access_token"/>
</VariablesToExtract>
</AuthRequest>