xman
Posts: 0
Joined: Sun Jul 06, 2014 7:05 pm

Getting 401 Unauthorized error while trying to retrieve user info from DB.

"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".

xman
Posts: 0
Joined: Sun Jul 06, 2014 7:05 pm

Getting 401 Unauthorized error while trying to retrieve user info from DB.

I have searched through the forum and tried and verified that I was not having problems in my implementation as mentioned in those threads.

xman
Posts: 0
Joined: Sun Jul 06, 2014 7:05 pm

Getting 401 Unauthorized error while trying to retrieve user info from DB.

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.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Getting 401 Unauthorized error while trying to retrieve user info from DB.

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.

xman
Posts: 0
Joined: Sun Jul 06, 2014 7:05 pm

Getting 401 Unauthorized error while trying to retrieve user info from DB.

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

xman
Posts: 0
Joined: Sun Jul 06, 2014 7:05 pm

Getting 401 Unauthorized error while trying to retrieve user info from DB.

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).

xman
Posts: 0
Joined: Sun Jul 06, 2014 7:05 pm

Getting 401 Unauthorized error while trying to retrieve user info from DB.

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?)

xman
Posts: 0
Joined: Sun Jul 06, 2014 7:05 pm

Getting 401 Unauthorized error while trying to retrieve user info from DB.

I am stuck since 10 hours now, and waiting for Appery experts to help since 7 hours. Does anybody care?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Getting 401 Unauthorized error while trying to retrieve user info from DB.

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.

Return to “Issues”