telepat-io / telepat-api

This is the Telepat API where HTTP calls are made. CRUD operations are not processed here directly. Messages are sent to the Telepat workers where CRUD operations are being taken care of along with client communication (notifications).
http://telepat.io
Other
332 stars 21 forks source link

What is the link with Facebook? #1

Closed Tails closed 9 years ago

Tails commented 9 years ago

In the API, as well as in the code for the JS example, a link with Facebook is laid to check some login state. What is the relation with Facebook here? How are FB access tokens used? Why? Is this link with Facebook neccessary or could the JS code also functionally be used without Facebook or a Facebook account?

gabidobo commented 9 years ago

You use the Facebook token to log users into Telepat. Server-side, we use the token to make a request to the Graph API, in order to get the user's details and create/update their account. This is useful if you want to give some data access rights only to logged-in users, for example, but generally you can use Telepat without needing to log users in.

jezell commented 9 years ago

+1 I thought this project looked awesome, and then I saw that. IMO should drop that requirement like a bad habit and make it some optional feature that the .00001% of people who think it's good can use.

Mayhem93 commented 9 years ago

@jezell It's not required anymore. We have our own users now which can be linked to facebook ( there's an api endpoint called /user/login_password )

jezell commented 9 years ago

Awesome! Looks like that info is missing from the API docs. Digging into the source and the way users works in the FB model is much nicer than trying to use an external user store. Would be nice if I could pass oauth token like FB style and configure a metadata URL for the users to make integration with another user API that supports oauth nice and clean. I think introducing a provider model here could allow a bit more flexibility.

andreimarinescu commented 9 years ago

@jezell You're right, that's actually something we want to do. We went for Facebook first as it was the lowest fruit to pick, but we want to add an abstraction layer for authentication so that things are more flexible.