Unauthorised and NoSession
Monday, December 18, 2017 at 06:05pmWhenever I make request to the https://sandbox.esignlive.com/api, I am getting the following error message {"messageKey":"error.unauthorised.noSession","message":"Failed to retrieve Session","code":401,"name":"Unauthorized"}.
I am using visual studio for development. I have break point at the request line. On the first request it always gives me Unauthorized error and when I drag the code execution to the same request again I am getting the results with status code (200) OK and data correctly.
If it is a problem with my API key, then the request should always return Unauthorized message, but it happens only on the first call.
Reply to: Unauthorised and NoSession
Tuesday, December 19, 2017 at 05:07amReply to: Unauthorised and NoSession
Tuesday, December 19, 2017 at 05:57pmReply to: Unauthorised and NoSession
Tuesday, December 19, 2017 at 06:02pmReply to: Unauthorised and NoSession
Wednesday, December 20, 2017 at 04:53amReply to: Unauthorised and NoSession
Wednesday, December 20, 2017 at 04:55amReply to: Unauthorised and NoSession
Thursday, December 21, 2017 at 12:33amReply to: Unauthorised and NoSession
Friday, December 22, 2017 at 04:14amReply to: Unauthorised and NoSession
Monday, January 1, 2018 at 06:14pmReply to: Unauthorised and NoSession
Wednesday, January 3, 2018 at 11:28pmReply to: Unauthorised and NoSession
Monday, January 8, 2018 at 06:56amReply to: Unauthorised and NoSession
Monday, November 12, 2018 at 05:25amReply to: Unauthorised and NoSession
Tuesday, November 13, 2018 at 05:52amGET /api/sysinfo
oreslClient.getSystemService().getApplicationVersion()
in SDK to test your connection with OneSpan Sign? DuoReply to: HitestsnCanyou
Friday, April 23, 2021 at 01:55pmHi Duo,
we tried to use proxy to connect to Saas, we got the same issue, 1st call gets 401, then the next request is working.
error return:
{"messageKey":"error.unauthorised.noSession","message":"Failed to retrieve Session","code":401,"name":"Unauthorized"}
any idea?
thanks,
Reply to: Hi Duo, we tried to use…
Sunday, April 25, 2021 at 07:30pmHi Cindy,
Is it consistent that the first call always fails? Which particular API or function caused this 401 error, or any API or function as long as it's the first call?
Are you developing with Java, .NET SDK or RESTful API? API Key vs API Token? Could you share the code around how you build the EslClient or HttpClient?
Duo
Reply to: Hi Cindy, Is it…
Monday, April 26, 2021 at 02:57pmHi Duo,
we found out that without proxy (via internet) we don't have issue at all, so we suspect this is the proxy issue. since I saw somebody post the exact the same issue here but doesn't found the root cause and solution. from your experience, do you have any idea?
thanks,
Cindy
Reply to: Hi Duo, we found out that…
Monday, April 26, 2021 at 06:51pmHi Cindy,
The 401 error could indicate:
#1 The connection doesn't get blocked by proxy
#2 However somehow the request header "Authorization" is either removed or changed by the proxy.
Hence are you able to pull the outbound raw request from your proxy server? Does the proxy allow you to test against it via another HTTP client (e.g. Postman/Curl from your local)? Or any possible to test through another proxy?
Duo
Reply to: Hi Cindy, The 401 error…
Tuesday, April 27, 2021 at 08:34amHi Duo,
the strange thing is only failed at 1st time or 2nd time for the same request, the subsequent request are all successful, if the connection the request header "Authorization" is removed or changed, why the subsequent requests are successful.
I will try to see if I can get raw request from our proxy server, is it possible to ask Onespan to look at sandbox log to see what request they got? why onespan return 401 for 1st time?
Yes, I tried to test from SOA test from my local and got the same result via same proxy.
Another thing I want to ask is the error message (401)we got as below, but actually it's nothing to do with session, right? I tested it, as I mentioned that once getting successful request, all the subsequent ones are successful without any time period, so I suspect nothing to do with session. please confirm.
{
"messageKey" : "error.unauthorised.noSession",
"message" : "Failed to retrieve Session",
"code" : 401,
"name" : "Unauthorized"
}
Reply to: Hi Duo, the strange thing…
Tuesday, April 27, 2021 at 08:39amYes, the error message is not necessary related to session. If you simply hit this link:
"https://sandbox.esignlive.com/api/packages/07YTkf-tiKA0IBdIm5hvAI-cPzE=" in your browser (It's a GET /api/packages/{packageId} call, refers to a package created by me)
it returns you the same error message.
Duo
Reply to: Yes, the error message is…
Tuesday, April 27, 2021 at 08:45amI see, I removed "Authorization: Basic ${API_KEY}" in the header, I got 401 all the times.
by the way, is it possible to check sandbox log to see what Onespan get for the 401 error?
this is my request:
GET https://sandbox.esignlive.com/api/packages/5uQLpwRrjhuSmtYG5oaioxQwXBc= HTTP/1.0
Host: sandbox.esignlive.com
Authorization: Basic RExxxQ==
Accept: application/json; esl-api-version=11.21
thanks,
Cindy
Reply to: I see, I removed …
Tuesday, April 27, 2021 at 10:29amHi Cindy,
Just consulted with our support team and seems due to security concern, the "Authorization" header won't be logged no matter whether it's included in the request.
Duo
Reply to: Unauthorised and NoSession
Wednesday, April 28, 2021 at 08:56amthanks for the information. meanwhile, I am trying to see if I can get raw request from our proxy.
BTW, I tested from Postman ->Proxy ->SaaS, and I am getting the same result.
Reply to: Unauthorised and NoSession
Thursday, April 29, 2021 at 11:21amHi Duo,
Regarding this issue, I found out the difference between successful request vs error one (401), the difference is Cookie. if there is Cookie, it's successful, and it gets 401 without Cookie. does it make sense to you?
Successful one:
GET https://sandbox.e-signlive.ca/api/packages/oaSfJlDW19aMSi9fnWR8EVjv9o0= HTTP/1.1
Host: sandbox.e-signlive.ca
Authorization: Basic NldxxQ==
Accept: application/json; esl-api-version=11.21
Cookie: BCSI-CS-1a37b6c6e9fad08c=1
Error One:
GET https://sandbox.e-signlive.ca/api/packages/oaSfJlDW19aMSi9fnWR8EVjv9o0= HTTP/1.1
Host: sandbox.e-signlive.ca
Authorization: Basic NlxxQ==
Accept: application/json; esl-api-version=11.21
Reply to: Hi Duo, Regarding this…
Thursday, April 29, 2021 at 11:32amHi Cindy,
As per below article, seems this cookie is set by proxy server and to determine if to forward credentials upstream - This is to avoid leaking enterprise credentials to an external server in most cases. Leaking credentials would be a serious security risk, especially when Basic credentials were used.
https://knowledge.broadcom.com/external/article/200712/what-is-the-http-header-bcsics-cookie-se.html
Duo
Reply to: Hi Cindy, As per below…
Thursday, April 29, 2021 at 12:10pmthanks for the information. Does Onespan check cookie in the request? I will check with our proxy team to see why sometimes it set the cookie, and sometimes not.
but from Onespan, it seems the request with cookie is successful.
Cindy
Reply to: thanks for the information…
Thursday, April 29, 2021 at 12:12pmOneSpan Sign won't expect cookie in the request, except "ESIGNLIVE_SESSION_ID", which is used for UI interactions.
Duo
Reply to: OneSpan Sign won't expect…
Thursday, April 29, 2021 at 12:14pmI see. probably without cookie, upstream won't get authentication which make it fail.
Reply to: OneSpan Sign won't expect…
Monday, May 3, 2021 at 01:20pmHi Duo,
I tried the one flow as our application server -> Proxy ->SaaS.
I have same request if it's sending to US sandbox, it is working fine, but if it's sending to CA sandbox, I got the below error:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Is there any setting different between US and CA sandbox?
thanks,
Cindy
Reply to: Hi Duo, I tried the one…
Monday, May 3, 2021 at 01:28pmHi Cindy,
Please make sure either the root CA or leaf certificate of CA sandbox environment has been added to your JRE trust chain, as per below documentation:
https://community.onespan.com/documentation/onespan-sign/guides/admin-guides/user/updating-certificates
If this still doesn't work, can you try connecting to CA sandbox without proxy?
Duo
Reply to: Unauthorised and NoSession
Monday, May 3, 2021 at 02:49pmHi Duo,
thanks for the information. after i import the cert in my trust store, it works.
in the cert which I download from your website, it contains 3 certification. what's the purpose for each certificate (eSignlive.ca, globalSign, globalSign GCC)? and which one should be imported?
thanks,
Cindy
Reply to: Hi Duo, thanks for the…
Tuesday, May 4, 2021 at 08:21amHi Cindy,
Do you mean the root RA, intermediate RA and the leaf certificate in the chain path?
I believe only to import leaf certificate should be sufficient.
Duo
Reply to: Unauthorised and NoSession
Tuesday, May 4, 2021 at 08:25amleaf cert will be expired on Nov 2021, and root cert will be expired on 2029, and currently I imported root cert and seems working.
Reply to: leaf cert will be expired on…
Tuesday, May 4, 2021 at 08:35amYes, leaf certificate will be rotated before it got expired, and theoretically import any of these three certificates will work.
Duo