Click HERE to see how Saviynt Intelligence is transforming the industry. |
05/07/2024 09:12 AM
How can I configure the REST connector to refresh both the access token and refresh token in the ConnectionJSON?
{
"authentications": {
"userAuth": {
"authType": "oauth2",
"url": "https://example/oauth2/token",
"httpMethod": "POST",
"httpParams": {
"grant_type": "refresh_token",
"client_secret": "abcd",
"client_id": "abcd",
"refreshToken": "abcd"
},
"httpHeaders": {
"contentType": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"invalid_grant",
"invalid_target_scope"
],
"retryFailureStatusCode": [
401
],
"timeOutError": "Read timed out",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"accessToken": "Bearer abcd"
}
}
}
Solved! Go to Solution.
05/07/2024 09:27 AM
Hi @Testy ,
This documentation helps you to achieve it: https://docs.saviyntcloud.com/bundle/Dev-Handbook-REST-v24x/page/Content/Developers-Handbook.htmDeve...
Covers:
If this answers your questions, please consider selecting Accept As Solution and hit Kudos
05/07/2024 09:30 AM
can't access that link
05/07/2024 09:31 AM - edited 05/07/2024 09:34 AM
@Testy : you may need to have partners account to access this link. Looks like it is not exposed to everyone.
For reference you can use below sample JSON
Renew Access Token and Refresh Token using Single API
{
"authentications": {
"userAuth": {
"authType": "oauth2",
"url": "https://<domain name>/v1/access_token",
"httpMethod": "POST",
"httpParams": {
"client_id": "<client ID>",
"client_secret": "<client secret>",
"grant_type": "refresh_token",
"refresh_token": "${refresh_token}"
},
"httpHeaders": {
"Content-Type": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"USER_AUTHENTICATION_FAILED",
"PARTNER_AUTHENTICATION_FAILED",
"AuthenticationFailed"
],
"refreshType": "RefreshToken",
"refreshTokenResponsePath": "refresh_token",
"refreshToken": "<refresh token>",
"timeOutError": "Read timed out",
"errorPath": "errorCode",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"retryFailureStatusCode": [
401
],
"accessToken": "Bearer <token>"
}
}
}
Renew Access Token and Refresh Token using Different API:
{
"authentications": {
"userAuth": {
"authType": "oauth2",
"url": "https://<domain name>/oauth/token",
"httpMethod": "POST",
"httpParams": {
"company_id": "<>",
"client_id": "<>",
"grant_type": "<>",
"assertion": "${refresh_token}"
},
"httpHeaders": {
"Content-Type": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded",
"authError": [
"Unable to authenticate the client",
"Invalid OAuth token Bearer"
],
"retryFailureStatusCode": [
401
],
"errorPath": "",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"refreshType": "RefreshToken",
"tokenType": "Bearer",
"accessToken": "Bearer asdsdfghjk",
"refreshToken": "<>",
"refreshTokenAuthError": [
"Unable to retrieve SAML assertion",
"The provided SAML assertion is expired"
],
"refreshTokenErrorPath": "errorMessage",
"refreshTokenCall": {
"refreshTokenResponsePath": "",
"url": "https://<domain name>/oauth",
"httpMethod": "POST",
"httpParams": {
"client_id": "<>",
"user_id": "<>",
"token_url": "https://<domain name>/oauth/token",
"private_key": "<>"
},
"httpHeaders": {
"Content-Type": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded"
}
}
}
}