-
Notifications
You must be signed in to change notification settings - Fork 106
Add Authorization Code and Access Token docs for social login #521
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Robin! Took me awhile to test all this, but looks awesome. I added some comments about renaming the sections & beefing up the scope explanation :)
|
||
By default the configuration ``web.social.facebook.scope`` is set to ``email``. Change | ||
this configuration value to request additional scopes. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs a little more detail. It should link to the scopes that are available (https://developers.facebook.com/docs/facebook-login/permissions) and explain what adding extra scopes do. For ex, if I set the scope to "email,user_friends", how do I access this data? Same for the Google/LinkedIn sections
} | ||
|
||
When successful you'll receive a ``200 OK`` response. If the login fails a ``401 Unauthorized`` response will be returned. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also add that the account is returned on 200 in all of these sections 👍
Simple, right?! | ||
|
||
Logging in using an Access Token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but I see what you mean about the title & placement of the new section. I think this section and ‘Test it Out’ should be renamed. I would rename ‘Test it Out’ to something like Standard auth, or Default auth. This implies that the standard/easy way of doing things is to visit /login, click on the FB button, input credentials, etc. Then you can rename your section to something like Facebook SDK Auth, or Facebook Access Token Auth, since this section shows an alternative. Same with Google/LinkedIn sections
Logging in using an Access Token | ||
................................ | ||
|
||
If you want to use a Facebook SDK to login a user you can easily do so by grabbing the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like your explanations at the beginning of the Google & LinkedIn sections. I would add that same explanation here if it applies. "Using the Access Token (implicit) workflow is preferable when you're logging in from a place where the storage can be trusted. E.g. from your back-end where only you have access to the Access Token."
Really good stuff, directly relates to what I'm currently trying to accomplish with Google. With that, the redirect URI is something I need to handle at the React level. I get the response back which includes the queryString params of Is this something specific to the individual FE SDK and thus should be excluded from the docs since they're really meant for server side applications which are agnostic to the underlying SDK? My redirect looks something like this(Note the |
Add Authorization Code and Access Token docs for social login.
How to verify
$ npm run docs
./docs/_build/html/social_login.html
to view the new docs.Discussion
postmessage
as the callback uri when authenticating using the Google provider. But I did not really understand that, and the Google docs aboutpostmessage
was very thin.Logging in using an Authorization Code
andLogging in using an Access Token
are currently placed after the sectionTest it Out
. This feels strange. Any suggestions on how to make it better?Fixes #380