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

Rest Connector Issue: Connection json parse error

Sivagami
Valued Contributor
Valued Contributor

HI Team,

Basic auth json looks like below. Some apps use windows auth for accessing the API's. So, the username would be something like domain\myusername. When passing in saviynt we need to pass the username with escape character like this domain\\myusername

When such usernames are embedded in connection json, we are receiving parse error when import is trying to run & the system fails the import. If I try any other username with double backslash, there is no connection json parse error. 

{
    "authentications": {
        "acctAuth": {
            "authType": "basic",
            "errorPath": "error.code",
            "maxRefreshTryCount": 5,
            "tokenResponsePath": "access_token",
            "properties": {
                "userName":"domain\\myusername",
                "password": "mypassword"
            },
            "authError": [
                "InvalidAuthenticationToken",
                "AuthenticationFailed"
            ],
            "retryFailureStatusCode": []
        }
    }
}

Error in logs below:

2022-10-13 18:18:42,577 [quartzScheduler_Worker-12] DEBUG rest.RestProvisioningService  - Error parsing ConnectionJSON. Please verify if it is valid
2022-10-13 18:18:42,577 [quartzScheduler_Worker-12] DEBUG rest.RestProvisioningService  - Exception in RestProvisioiningService.doImport :
java.lang.Exception: Error parsing ConnectionJSON. Please verify if it is valid
	at com.saviynt.provisoning.rest.RestProvisioningService.initializeConnectionForImport(RestProvisioningService.groovy:1855)
	at com.saviynt.provisoning.rest.RestProvisioningService.doImport(RestProvisioningService.groovy:120)
	at com.saviynt.ecm.integration.ExternalConnectionCallService.invokeExternalMethod(ExternalConnectionCallService.groovy:186)
	at ApplicationDataImportJob.execute(ApplicationDataImportJob.groovy:206)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:199)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546)

Please help check how can I alter my connection json to help accept this windows auth usernames with backslash. 

Note: I have seen this kind of connection json work in lower versions. This behavior I noticed in v5.5 SP 3.12.7

-Siva 

2 REPLIES 2

rushikeshvartak
All-Star
All-Star

Try 4 backslash

{
	"authentications": {
		"acctAuth": {
			"authType": "basic",
			"errorPath": "error.code",
			"maxRefreshTryCount": 5,
			"tokenResponsePath": "access_token",
			"properties": {
				"userName": "domain\\\\myusername",
				"password": "mypassword"
			},
			"authError": [
				"InvalidAuthenticationToken",
				"AuthenticationFailed"
			],
			"retryFailureStatusCode": []
		}
	}
}

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

Using four backslash for username with one backslash works. Thanks much!

-Siva