Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Error while creating Okta users with credentials

Aashish-Handa
Regular Contributor
Regular Contributor

Hi Team,

We are trying to provision accounts to OKTA via a REST OOTB connector using an Okta API with credentials for that user to login as well. The API works fine via POSTMAN and the user is able to login. However, when we try to replicate the API in Saviynt, it gives us the below error:

{\"message\":\"Unexpected character ('}' (code 125)): was expecting a colon to separate field name and value\\n at [Source: {\\\"profile\\\": {\\\"firstName\\\": \\\"Okta\\\", \\\"lastName\\\": \\\"UAT2\\\",\\\"displayName\\\": \\\"Okta UAT2\\\", \\\"organization\\\": \\\"xxxxxx xxxx Hong Kong CO LTD\\\", \\\"email\\\": \\\"Okta.Uat2@xxxx.cn\\\", \\\"login\\\": \\\"Okta.Uat2@xxxx.cn\\\"},\\\"credentials\\\": {\\\"password\\\": {\\\"value\\\": {\\\"************\\\"} }}}; line: 1, column: 279]\",\"status\":\"Failed\"}

AashishHanda_0-1706107219422.png

The createaccountjson is below:

{
"accountIdPath": "call1.message.id",
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://XXXX.okta.com/api/v1/users?activate=true",
"httpMethod": "POST",
"httpParams": "{\"profile\": {\"firstName\": \"${user.firstname}\", \"lastName\": \"${user.lastname}\",\"displayName\": \"${user.displayname}\", \"organization\": \"${user.companyname}\", \"email\": \"${user.email}\", \"login\": \"${user.email}\"},\"credentials\": {\"password\": {\"value\": {\"${password}\"}}}}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
204,
201,
200
]
},
"unsuccessResponses": {
"statusCode": [
404,
401,
400
]
}
}
]
}

We would like to provision the user account with the credentials mapped to it, can we please get some assistance on the resolution here.

Please let us know for any other information as well.

Thanks,

Aashish Handa

8 REPLIES 8

adarshk
Saviynt Employee
Saviynt Employee

Can you confirm if the provisioning is working fine without passing the credentials/password.?

Yes, the provisioning works fine then. Please find the createaccountjson without credentials:

{
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://xxxxx.okta.com/api/v1/users",
"httpMethod": "POST",
"httpParams": "{\"profile\": {\"firstName\": \"${user.firstname}\", \"lastName\": \"${user.lastname}\",\"displayName\": \"${user.displayname}\", \"email\": \"${user.email}\", \"login\": \"${user.email}\" }}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json"
}
]
}

Thanks

Aashish-Handa
Regular Contributor
Regular Contributor

Hi @adarshk ,

Were you able to check?

Are we missing any syntax in the config with credentials?

Thanks

adarshk
Saviynt Employee
Saviynt Employee

Hi Ashish,

Please share the POSTMAN Request and Response for this

Aashish-Handa
Regular Contributor
Regular Contributor

Hi @adarshk ,

Sure, PFB:

URL : https://xxxx.okta.com/api/v1/users?activate=true

Body: 

{
  "profile": {
    "firstName": "Isaac1",
    "lastName": "Brock1",
    "email": "isaac1@abc.com",
    "login": "isaac1@abc.com"
  },
  "credentials": {
    "password" : { "value": "mwG2fN#nwbvqJzjx" }
  }
}
 
Thanks

 

Does hardcoded password works ?


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

Aashish-Handa
Regular Contributor
Regular Contributor

Works for postman, in general. When moving it to Saviynt, we will be using a password policy.

Thanks

Hardcode password in saviynt JSON and try


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