Authenticate android app user

53 views
Skip to first unread message

Reshad Farid

unread,
Oct 18, 2016, 2:04:42 PM10/18/16
to sails.js
Hello.


I found out that sails is using server side sessions ( which can be handled by browsers perfectly fine ) but not by android apps by default. 

My question is, what should I do to achieve this for my android app? Do I need to return some sort of api key or a token of some sort? 

if so, please suggest an example or tutorial since I am a newbie with sails :) 

Jaime Giraldo

unread,
Oct 19, 2016, 12:51:04 PM10/19/16
to sails.js
Sails sets a "sails.sid" cookie each request it receives. You have to handle that cookie from Header "set-cookie", set it to a variable in you android app and then each request you compound, attach the "Cookie" header. When the header Cookie is present set-cookie will not come anymore.

r.li...@ag-isw.at

unread,
Mar 31, 2017, 2:45:02 AM3/31/17
to sails.js
Another possibility would be the use of JSON Web Tokens.

https://thesabbir.com/how-to-use-json-web-token-authentication-with-sails-js/

Robert Main

unread,
Mar 31, 2017, 3:09:28 AM3/31/17
to r.li...@ag-isw.at, sails.js
I think json web tokens is the way forward here
Reply all
Reply to author
Forward
0 new messages