Skip to main content

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.

Image 1: Other Configuration Settings Available

Example

The following example retrieves a bearer token in a REST API sync.

ParameterDescriptionExample
HTTP MethodPOST
Endpoint URLThe Cinchy endpoint used to retrieve the token.https://{Cinchy SSO URL}/identity/connect/token
Request Headers - Content Type - NameMust be set to Content-TypeContent-Type
Request Headers - Content Type - Header ValueMust be set to application/x-www-form-urlencodedapplication/x-www-form-urlencoded
BodyThe body content used to retrieve the token. Review the parameters for this section hereclient_id=<your client id>&amp;client_secret=<your secret>&amp;username=<your username>&amp;password=<your password>&amp;grant_type=password&amp;scope=js_api
Variables to Extract - NameThe name of your variable.access_token
Variables to Extract - Path in ResponseThe variable path.$.access_token

Calling a bearer token for a REST API source sync

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>&amp;client_secret=<your secret>&amp;username=<your username>&amp;password=<your password>&amp;grant_type=password&amp;scope=js_api</Body>
<VariablesToExtract>
<Variable name="access_token" pathInResponse="$.access_token"/>
</VariablesToExtract>
</AuthRequest>