Page 1 of 3
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Wed Jul 16, 2014 8:50 pm
by xman
"status":"401 Unauthorized",
"url":"https://api.appery.io/rest/1/db/users...",
"response":{
"code":"DBUG001",
"description":"unauthorized"
service settings: http://awesomescreenshot.com/01835tfgb4
request: http://awesomescreenshot.com/03f35tfl6a
Request-mapping:http://awesomescreenshot.com/06335tfx69
the JS in "where" is:
return '{"username": "' + encodeURIComponent(value) + '"}';
Resonse-mapping: http://awesomescreenshot.com/01235tgd21
The LSV's first_name and last_name are being printed to a lable/list. The service is invoked on page_show, and I get "null" and "null" for both these variables printed on the label. When I added JS to each of these LSV's and printed out with alert, they show "undefined".
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Wed Jul 16, 2014 8:53 pm
by xman
I have searched through the forum and tried and verified that I was not having problems in my implementation as mentioned in those threads.
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Wed Jul 16, 2014 9:15 pm
by xman
I've already tried Victor's suggestion here: https://getsatisfaction.com/apperyio/...
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Wed Jul 16, 2014 9:54 pm
by xman
I really have to get this working for a deadline to a demo, it sucks!
This had worked intermittently, but now I can't get it to work at all.
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Thu Jul 17, 2014 12:41 am
by Yurii Orishchuk
Hi Xman,
Please specify: do you pass correct "X-Appery-Session-Token" parameter?
See details: http://prntscr.com/43flye/direct
Also please give us your request screen shot where we can see url request parameters and request headers.
Thanks & regards.
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Thu Jul 17, 2014 1:55 am
by xman
Yes, I am passing in X-Appery-Session-Token parameter. The request screen shot was already linked, but here it is again: http://awesomescreenshot.com/03f35tfl6a
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Thu Jul 17, 2014 2:08 am
by xman
Also if you see the mapping screen shot linked in the original/first post above, you'll see that X-Appery-Session-Token is mapped to LSV userSessionId (the LSV name is misleading, but it really stores the session token from the login service success).
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Thu Jul 17, 2014 2:28 am
by xman
Another update: I printed the session token from my web test area using alert() and then copied it over back into the manual test field for the service and clicked "test". It appears that the test passes. See here:
http://awesomescreenshot.com/0d035uos18
Now my question is that, this is the same sessionToken which is mapped if you see the mapping above. Why is it not working? (if it's working in the manual testing?)
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Thu Jul 17, 2014 4:15 am
by xman
I am stuck since 10 hours now, and waiting for Appery experts to help since 7 hours. Does anybody care?
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Thu Jul 17, 2014 4:29 am
by Yurii Orishchuk
Dear xman,
We still need your screen shot from the browser debug network tab.
See example of screen shot: http://prntscr.com/43hbo3/direct
Regards.