-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OCR API Result URL Authentication Failure #36
Comments
Use no auth - the URL which you obtained from |
Thank you @Dmitry-Me for replying. As said, I've also tried calling the last resultUrl with No-Auth but then, I get 401. I'll post the Charles (proxy server) log asap 👍 |
Hi again ( @Dmitry-Me ). Here are my infos from Charles (mac proxy server): getTaskStatus request:
getTaskStatus response:
download URL request:
download URL response:
|
The second |
Hi @Dmitry-Me, as said, I've tried to access it without AUTH request. As I've already said, I've tried that solution already. But I didn't tried it more times in a row. So, when making a request, I usually also got (403) error for resultUrl. 2nd request also fails. Usually, at 3rd or 4th request then it finally works. Can you please tell me why is that so? |
Do you have a piece of log showing how it takes several attempts? |
Of course @Dmitry-Me Test #1: SUCCESS
Test #2: FAIL
Test #3: FAIL
Test #4: SUCCESS
Test #5: FAIL
Test #6: SUCCESS
|
You can see that successful requests differ from failed ones in one aspect only - requests fails when there's at least one "plus" character in the "sig" parameter. Plus and slash are reserved characters and must be percent-encoded https://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_reserved_characters Which language/framework are you using? We'd like to make some effort to improve our code samples. |
I thought that too @Dmitry-Me but the first Successful request SIG also has / in it. And it works. However, I'll try to encode url so we get %20 etc instead of special characters and report results again. This is being developed in front-end JS (no Node app). Pure Angular way. |
So technically it's just JavaScript, isn't it? Btw how will you guard your application password if it's client side code? |
Exactly. The app is currently being developed. Later, we're going to send requests to our proxy, which will append app id and password to http requests so no credentials are going to be stored in app itself 👍 |
here's the update: I was always decoding URL which I got from TaskStatus Completed. Taking the URL directly from response and calling it without auth, it works. So it was actually my error. I would suggest, however, that you update your DOC or code and comment in the info, NOT TO ENCODE the recieved url but just use it as is. Thank you very much for your support @Dmitry-Me. You were really really helpful. Kind regards, Gregor |
Well, the Node.js sample seems to do just that - https://github.com/abbyysdk/ocrsdk.com/blob/master/JavaScript/test.js#L61 How can that be improved? |
I've tried several times now, to open resultUrl which I get from scanning business card. Everytime I get
So, what am I doing wrong then?
I'm using $http requests through Angular App. I've tried to request the GET with POSTMAN with the same result.
Thank you for your feedback.
The text was updated successfully, but these errors were encountered: