kaysonk

Received [401, Unauthorized] response

0 votes
Hi, I am receiving the error [401, Unauthorized] response when creating a package with JavaSDK. Here is the error message: com.silanis.esl.sdk.internal.EslServerException: Could not create a new package Exception: HTTP POST on URI https://sandbox.esignlive.com/api/packages resulted in response with status code: [401, Unauthorized]. Optional details: {"messageKey":"error.unauthorised.noSession","code":401,"name":"Unauthorized","message":"Failed to retrieve Session"} at com.silanis.esl.sdk.service.PackageService.createPackage(PackageService.java:92) at com.silanis.esl.sdk.EslClient.createPackage(EslClient.java:260) at com.silanis.esl.sdk.EslClient$createPackage.call(Unknown Source) at createPackage_script_New_operation.run(createPackage_script_New_operation:180) Caused by: com.silanis.esl.sdk.internal.RequestException: HTTP POST on URI https://sandbox.esignlive.com/api/packages resulted in response with status code: [401, Unauthorized]. Optional details: {"messageKey":"error.unauthorised.noSession","code":401,"name":"Unauthorized","message":"Failed to retrieve Session"} at com.silanis.esl.sdk.internal.RestClient.execute(RestClient.java:214) at com.silanis.esl.sdk.internal.RestClient.post(RestClient.java:120) at com.silanis.esl.sdk.service.PackageService.createPackage(PackageService.java:89) ... 3 more Exception was thrown from script: This has been working before but it start giving the above response since Nov 8, 2018. Thanks, Kayson

Reply to: Received [401, Unauthorized] response

0 votes
Hi Kayson, Can you try calling below function (get application version) to test your connection with OneSpan Sign?
System.out.println(eslClient.getSystemService().getApplicationVersion()); 
Did you change the instance endpoint url or your api key? And are you using a proxy? Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Received [401, Unauthorized] response

0 votes
Hi Duo, I tried what you suggested and got the following error: com.silanis.esl.sdk.EslException: Could not get application version. at com.silanis.esl.sdk.service.SystemService.getApplicationVersion(SystemService.java:34) at com.silanis.esl.sdk.service.SystemService$getApplicationVersion.call(Unknown Source) at createPackage_script_New_operation.run(createPackage_script_New_operation:99) Caused by: com.silanis.esl.sdk.internal.RequestException: HTTP GET on URI https://sandbox.esignlive.com/api/sysinfo resulted in response with status code: [401, Unauthorized]. Optional details: {"messageKey":"error.unauthorised.noSession","code":401,"name":"Unauthorized","message":"Failed to retrieve Session"} at com.silanis.esl.sdk.internal.RestClient.execute(RestClient.java:214) at com.silanis.esl.sdk.internal.RestClient.get(RestClient.java:324) at com.silanis.esl.sdk.internal.RestClient.get(RestClient.java:316) at com.silanis.esl.sdk.service.SystemService.getApplicationVersion(SystemService.java:29) ... 2 more

Reply to: Received [401, Unauthorized] response

0 votes
Hi Kayson, So there was something wrong with your connection to OneSpan Sign. Can you log onto your web portal and see your dashboard with your credentials? Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Received [401, Unauthorized] response

0 votes
Hi Duo, Yes, I can logon to Onespan portal with my credentials. Thanks, Kayson

Reply to: Received [401, Unauthorized] response

0 votes
Hi Kayson, So first can you double check that your api key and environment URL is correct? You can click on the dropdown list beside your name on the right top of your dashboard, choose "Admin" and in the "Integration" section from the left part of your admin page, you can click on the eye and shown your api key. And your environment url is the same as the endpoint of your dashboard url. If these are correct, did you use a proxy with your JVM? Can you try call the same api with Postman? Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Received [401, Unauthorized] response

0 votes
Hi Duo, Yes, we have to go through our proxy. and too bad we cannot test it with Postman as we cannot install Postman on our server. Can Onespan check to see if any request is hitting Onespan with my account? Thanks, Kayson

Reply to: Received [401, Unauthorized] response

0 votes
Hi Kayson, One more question, what Java SDK version are you using? Have you upgraded the SDK recently? Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Received [401, Unauthorized] response

0 votes
We were using version 11.15. But I also tried 11.20 and received the same error. Thanks, Kayson

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off