Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

ConnectionJSON for rest connector with Oauth2 authentication

FabianaS
New Contributor III
New Contributor III

Hello,

I'm working on a REST connector that should call a custom Web Service, receive a bearer access token and then do another API call for ChangePassJSON.

I've configured the WebService with OAuth2, using AuthorizationGrantType.CLIENT_CREDENTIALS and ClientAuthenticationMethod.CLIENT_SECRET_BASIC.

I'm using also Postman to test this workflow (successfully):

  • To receive an access token, I'm sending an http request to "http://xx.xxx.xxx.xxx:9001/oauth2/token"
  • In the header I have "Content-Type": "application/x-www-form-urlencoded"
  • In the header I have also "Authorization": "Basic ckcEKCfemkvsdm" (is the clientID:clientSecret in Base64)
  • In the body I have "grant_type": "client_credentials"

I'm using a testConnectionParams inside the ConnectionJSON to understand if everything is fine:

This is how I configured the ConnectionJSON:

{
"authentications":{
"acctAuth":{
"authType":"oauth2",
"url":"http://xx.xxx.xxx.xxx:9001/oauth2/token",
"httpMethod":"POST",
"httpParams": "{
\"grant_type\":\"client_credentials\"
}",
"httpHeaders":{
"Content-Type":"application/x-www-form-urlencoded",
"Authorization":"Basic ckcEKCfemkvsdm"
},
"httpContentType":"application/x-www-form-urlencoded",
"expiryError":"ExpiredAuthenticationToken",
"authError":[
"Unable to authenticate the client",
"Invalid OAuth token Bearer"
],
"retryFailureStatusCode": [
401,
403
],
"errorPath": "",
"maxRefreshTryCount": 5,
"tokenResponsePath":"access_token",
"tokenType":"Bearer",
"testConnectionParams": {
"http":{
"url": "http://xx.xxx.xxx.xxx:9001/api/changepsw",
"httpHeaders":{
"Authorization":"${access_token}",
"Content-Type":"application/json"
},
"httpContentType":"application/json",
"httpMethod":"POST",
"httpParams": "{\"username\": \"YYY\",
\"newPassword\": \"KKK\"
}",
"successResponse": [],
"successResponsePath": "",
"errors": [
"Couldn't authenticate you"
],
"errorPath": "error"
}
}
}
}
}

 

The error that I'm getting when "Save & Test Connection" is the following:

No signature of method: com.saviynt.provisoning.rest.RestUtilService.getDynamicBindString() is applicable for argument types: (java.util.LinkedHashMap, java.util.HashMap) values: [[username:YYY, newPassword:KKK], ...] Possible solutions: getDynamicBindString(java.lang.String, java.util.Map)

 

Little help on this?

Thank you,

F

10 REPLIES 10

NM
Esteemed Contributor
Esteemed Contributor

Hi @FabianaS , is change password working fine from postman?


If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'

FabianaS
New Contributor III
New Contributor III

yes

rushikeshvartak
All-Star
All-Star

What are special characters contains in password


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Just an exclamation point !

Can you change to @ and validate


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

still same problem

Could you kindly provide a detailed snapshot of the information extracted from the logs, encompassing errors and other pertinent functionality details encountered during the execution of this process? Your assistance in furnishing this information would greatly aid in the analysis and resolution of any issues .



‼️‼️⚠️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.⚠️‼️‼️


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Hi,

sorry for late reply.

I'm currently using this ConnectionJSON a bit revised:

{

   "authentications": {

       "acctAuth": {

           "authType": "oauth2",

           "url": "http://serverip:port/oauth2/token" ,

           "httpMethod": "POST",

           "httpParams": {

"grant_type": "client_credentials"

},

           "httpHeaders": {

               "Content-Type": "application/x-www-form-urlencoded",

               "Authorization": "Basic <clientIDandclientSecretinBase64>"

           },

           "expiryError": "ExpiredAuthenticationToken",

           "authError": [

               "Unable to authenticate the client",

               "Invalid OAuth token Bearer"

           ],

           "retryFailureStatusCode": [

               401,

               403

           ],

"httpContentType": "application/x-www-form-urlencoded",

           "errorPath": "error.code",

           "maxRefreshTryCount": 5,

           "tokenResponsePath": "access_token",

           "tokenType": "Bearer",

"testConnectionParams": {

       "http": {

         "url": "http://serverip:port/api/test",

         "httpHeaders": {

           "Authorization": "${access_token}"

         },

"httpContentType": "application/x-www-form-urlencoded",

         "httpMethod": "GET"

       },

       "successResponse": [],

       "successResponsePath": "",

       "errors": [

         "Couldn't authenticate you"

       ],

       "errorPath": "error"

     }

       }

   }

}

 

and the error that I'm getting is a timeout 408:

FabianaS_2-1724680014080.png

Same call from Postman are working fine. Could it be a connectivity issue between Saviynt and the virtual machine hosting the server?

Thank you

[This message has been edited by moderator to mask sensitive information]

  • You have issue with network connectivity
  • Check with N/w team

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

stalluri
Valued Contributor II
Valued Contributor II

@FabianaS 

Make sure you whitelist all the subnets instead of single IP along with the FQDN with Saviynt, and also check the connectivity from your SC 2.0 Machine to target is also working.


Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.