Page 1 of 1

Retrieve username or email on log in

Posted: Mon Jun 30, 2014 9:23 pm
by Brian6960095

I am trying to retrieve and save the username when the user logs in but all the response has is the _id and sessionToken. How do I receive the username as well.


Retrieve username or email on log in

Posted: Tue Jul 01, 2014 12:00 am
by Yurii Orishchuk

Hi Brian.

Please follow these steps to get user details:

1 Open login service mapping and make following response mapping:

http://prntscr.com/3y5i8o/direct

2 Create "getUser" REST service. http://devcenter.appery.io/documentat...

See details on screenshots:

URL: https://api.appery.io/rest/1/db/users...
http://prntscr.com/3y5fkm/direct

Request Tab parameters:
userId
X-Appery-Database-Id = {database_id}
X-Appery-Session-Token

http://prntscr.com/3y5fws/direct

3 Add "getUser" datasource to the page and create following mapping:
http://prntscr.com/3y5jj4/direct

4 Open "Events" buttom panel in page "data" mode and add "login" success event handler - invoke getUser service.
http://prntscr.com/3y5lro/direct

That's all

Regards.


Retrieve username or email on log in

Posted: Tue Jul 01, 2014 12:55 am
by Brian6960095

I at least feel better because I was already doing everything you had listed....unfortunately my problem still exists.

I think the problem stems from the fact that my "getUser" service won't even run when I try the test. I get the error:

Code: Select all

 "status":"401 Unauthorized", 
 "url":"[url=https://api.appery.io/rest/1/db/users/53b1a31be4b07420882b4720]https://api.appery.io/rest/1/db/users...[/url]", 
 "response":{ 
     "code":"DBUG001", 
     "description":"unauthorized" 

If I query any of the other collections it works fine, but it doesn't like it when I try to do it against the "users" table.


Retrieve username or email on log in

Posted: Tue Jul 01, 2014 9:08 pm
by Yurii Orishchuk

Hi Brian.

Now we need to see your implementation.

Thus, give us your app public link please.

Regards.


Retrieve username or email on log in

Posted: Tue Jul 01, 2014 9:29 pm
by Brian6960095

where do I get that from?


Retrieve username or email on log in

Posted: Tue Jul 01, 2014 11:55 pm
by Yurii Orishchuk

Brian,

See details on screen shot: http://prntscr.com/3yhtvx/direct

Regards.


Retrieve username or email on log in

Posted: Wed Jul 16, 2014 8:05 pm
by xman

What this issue resolved? I am getting similar issues like the original poster and I've tried all that I could. I think this was working sometime ago for me, but now I get the error message like stated above.


Retrieve username or email on log in

Posted: Wed Jul 16, 2014 10:12 pm
by Alena Prykhodko

Hello,

Let's continue here https://getsatisfaction.com/apperyio/.... Please stay tuned, we will reply as soon as possible.


Retrieve username or email on log in

Posted: Wed Jul 16, 2014 10:27 pm
by xman

Sure, I'm biting my nails here as I'm running out of time.