Comments (4)
Yeah, that makes sense.
Currently Assent OAuth 2.0 strategy only supports authorization code grant flow. I'm not sure if this is implicit grant flow, but I'll dig into the facebook docs to see how I should deal with the callback phase.
from assent.
So it looks like this would be specific to facebook instead of implicit grant flow:
As I understand it, this decodes the short lived access token from a cookie using the client secret, and then uses it to generate a long lived access token. Not sure if necessary with Assent, but I guess it can't hurt.
Edit: Facebook also suggests using code grant flow https://developers.facebook.com/docs/facebook-login/security#codeflow. I'll have to test this manually to see how it all works.
Also, this lib is probably the best reference: https://github.com/facebook/php-graph-sdk/blob/6d1eb5a3861624cd0ff40c67e517de891d78134a/docs/reference/FacebookJavaScriptHelper.md
from assent.
I've set up instructions for how to deal with Facebook JS SDK here: #44
from assent.
I'll close this as I believe both #44 and changes in the OAuth 2.0 strategy has made it very easy to handle with already fetched access token in client.
To recap:
- The Facebook strategy docs now highlights how to fetch the
code
client side to submit server side - The Assent OAuth 2.0 strategy now supports any grant type with
Assent.Strategy.OAuth2.get_access_token/3
to fetch the access token. Callback still uses the authorization code flow. Assent.Strategy.Facebook.get_user/2
could be used to fetch the user data with the access token.- Passing an access token straight to the backend is not recommended unless you reverify: https://developers.facebook.com/docs/facebook-login/web/accesstokens#confirm There might need to be a special method in the facebook strategy to handle this case, as I believe this is a facebook feature and not part of the oauth2 specs.
from assent.
Related Issues (20)
- Auth0: Support Variable-Length Access Token and Authorization Codes HOT 1
- PCKE support? HOT 2
- Multiple audiences HOT 5
- Allow to pass `state` parameter HOT 1
- Sign in with Apple: Strategy failed with error: :enoent HOT 1
- AssentJWT adapter returns unexpected value HOT 1
- Boolean field may contain an error-tuple which can cause issues HOT 1
- Warnings with Elixir 1.11 HOT 2
- mistaken double post, please excuse
- Reliance on inets? HOT 2
- Should OIDC fetch_user, fetch_userinfo, and validate_id_token allow for dynamic OpenID configuration? HOT 3
- OTP 24 :crypto.hmac/3 doesn't exist anymore HOT 2
- How to get the authorization code on react native for the Facebook strategy
- Callback param "user" is not parsed when using Apple strategy with "name" scope HOT 2
- Yandex OAuth Strategy
- Google Sign in for mobile strategy
- Using Tesla for HTTP HOT 1
- OIDC normalize/2 to conform to OAuth2 normalize/2 HOT 3
- Slack always "asks" for permission HOT 4
- Azure AD should expose more user info HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from assent.