java - User authorization on a rest service via an access token -


i have mobile application (html 5, javascript) , restful service (java, jersey) cater mobile application.

mobile application sign in handled via facebook (sign in using facebook account). , there no security mechanism integrated restful service

so question is, can authorize users on restful service via access token retrieved facebook, mobile application ? further clarify, if has logged mobile he/she should authorized make requests restful service.

thanks in advance asanka

if user has authenticated facebook , have access token you, can user's facebook profile's public information. you've got hit link - https://graph.facebook.com/me access token.

go ahead, click on link , see happens. when pass valid access token, profile info returned json object. (if fb profile page = facebook.com/yourname, try https://graph.facebook.com/yourname -> you'll able see data returned looks like.

now, user data returned can keep entry in db if user registered or not, first time users can register them.

ps - https://graph.facebook.com/yourname returns someone's profile info! didn't know keep profile handle yourname!!!
pps - checked facebook.com/yourname -> guess uses handle! it's brazilian defender roberto carlos!


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -