We are delighted to share our new EIC Delivery Methodology for efficiently managing Saviynt Implementations and delivering quick time to value. CLICK HERE.

how to integrate a target system only supports basic authentication with rest connection

Lynn
New Contributor II
New Contributor II

Hi Team,

Our client has an target system which is supporting REST API. But the system only supports basic authentication and user/password is required for every request.

REST connection Json parameters such as ImportAccountEntJSON expect Authorization header with Bearer token.
For example:
"Authorization": "${access_token}",

But the API of the target system only supports basic authentication
For example:
'Authorization: Basic YWRtaW46cGFzc3dvcmQ0YWRtaW4='

 

How can we integrate this target system with a rest connection?


Regards,
Lynn

10 REPLIES 10

rushikeshvartak
All-Star
All-Star

 

 

 

{
  "authentications": {
    "acctAuth": {
      "authType": "Basic",
      "url": "<URL>",
      "httpMethod": "POST",
      "httpParams": {},
      "httpHeaders": {},
      "httpContentType": "text/html",
      "properties": {
        "userName":"<<USERNAME>>/token",
        "password":"<<PASSWORD>>"
      },
      "expiryError": "ExpiredAuthenticationToken",
      "authError": [
        "InvalidAuthenticationToken",
        "AuthenticationFailed"
      ],
      "timeOutError": "Read timed out",
      "testname": "<test URL>",
      "errorPath": "error.code",
      "maxRefreshTryCount": 5,
      "tokenResponsePath": "access_token",
      "tokenType": "Basic",
      "accessToken": "Basic <<TOKEN>>",
      "apiRateLimitConfig": {"retryAfterCalls": 100,"retryWaitSeconds": 60}
    }
  }
}

https://docs.saviyntcloud.com/bundle/REST-v23x/page/Content/Developers-Handbook.htm 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi Rushiksh,

Thank you so much for the suggestions.

The json you provided is for ConnectionJSON. how about the CreateAccountJSON?

does the following json work?


{
"call": [
{
"name": "call1",
"connection": "ServiceNow",
"url": "<URL>",
"httpMethod": "POST",
"httpParams": "{httpParams**}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"unsuccessResponses": {
"error.message": "Operation Failed"
}
}
],
"accountIdPath": "call1.message.result.sys_id",
"responseColsToPropsMap": {}
}

 

Please note that our API only supports basic authentication. it expects user/password for the create account request.

Regards,

Lynn

 

It will work

Refer : https://docs.saviyntcloud.com/bundle/REST-v23x/page/Content/Examples-for-JSON-Construction.htm


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi Rushikesh,

I will try it out. Many thanks.

Regards,

Lynn

 

 

Lynn
New Contributor II
New Contributor II

Hi Rushiksh,

The solution you provided is working fine for basic authentication. Thank you so much.

We have another target system which is using custom authentication.

The Get token API is using the following headers:

custom-api-key: <api_key>
custom-signature: <encrypted_api_secret>


subsequent APIs use the token from the Get token API, but the header name is custom-session-token instead of Authorization.
custom-session-token: <api_token>

Can we integrate this target system with REST connection?


Regards,
Lynn

Dhruv_S
Saviynt Employee
Saviynt Employee

Hi @Lynn 

Please find the list of supported authentication types in REST connector.

Basic
BasicWithAccessToken
BasicWithHmac
OAuth
Cookies
SignedHeaders
JWT

Custom authentication is not supported. However, We will check and let you know if there is any way this can achieved.

Regards,
Dhruv Sharma

Lynn
New Contributor II
New Contributor II

Thank you so much for the help @rushikeshvartak @Dhruv_S 

Regards,

Lynn

 

Please accept the solution to help others 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Dhruv_S
Saviynt Employee
Saviynt Employee

Hi @Lynn 

Could you please provide more details about the custom authentication you are using. Is the custom authentication created using OAuth/JWT type or it is completely custom? Could you please provide the postman screenshots for better understanding. 

Regards,

Dhruv Sharma

Lynn
New Contributor II
New Contributor II

Hi Dhruv,

The target system is protected by datapower gateway. Below is the API specification we got:


Get API token

 This API will return the encrypted_api_signature and api_token for other APIs.

Method: POST
URL: https://{url}/services/api/sts/Session
Headers
x-csod-date: DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.000")
x-csod-api-key: <api_key>
x-csod-signature: <encrypted_api_secret>
Content-Type: text/xml
Accept: application/json
Content-Length: 0

Get user

Method: GET
URL: https://{url}/services/api/x/users/v1/employees/userid-{UserId}
Headers
x-csod-date: DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.000")
x-csod-session-token: <api_token>
x-csod-signature: <encrypted_api_signature>
Accept: application/json

 

Once I have access to the system, I will provide the postman screenshots.

Thanks a lot.

Regards,

Lynn