You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
- In step 1, use a session token, not a persistent one. In step two, you talk about sending a user's email. Where do you get it, and why do you need it? In step 3, you don't necessarily get an email adres back from Facebook, you do get a user id though.Kris Vandermotten– Kris Vandermotten2014-06-16 17:44:39 +00:00Commented Jun 16, 2014 at 17:44
- Thanks, but I don't use a session on the server because of the RESTful api. I just want to keep the user logged in until either the cookie or the access token expires. I get the email from the FB server when the user allows email access. I use it to identify the user record in my own database, because the Facebook userId doesn't correspond to the userId's in my own database. The only commong identifier that I see is the email address. Then I can store and cache the access token + userId of my own application.Trace– Trace2014-06-17 06:21:46 +00:00Commented Jun 17, 2014 at 6:21
- A session token just means a non-persistent one, it doesn't imply a session on the server. When a Facebook user logs in for the very first time, just create an internal user and remember the mapping between Facebook user id and internal user id. After that, for a second or later login, you have the mapping.Kris Vandermotten– Kris Vandermotten2014-06-17 18:15:35 +00:00Commented Jun 17, 2014 at 18:15
- Good idea. When I started to investigate about a way to merge accounts, I became aware that I need to create a local user and map that local userId to whatever 3rd party accounts that I have. Why I wanted to use a persistent cookie is because when the user closes the browser by accident, he would need to authenticate every time again (if eg. he would want to use my internal login system with email + password). Therefore I thought that saving user + token with expiry of eg. 60 minutes would be a good idea. Your opinion?Trace– Trace2014-06-18 10:08:41 +00:00Commented Jun 18, 2014 at 10:08
Add a comment |
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. web-application), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you