-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new Oauth2Authenticator using the new Symony 5.2 Authenticator … #292
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.
Hi there!
thanks for getting this started! I haven’t tested with it yet, but here’s a quick review to get things started. :).
Cheers!
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.
Just minor comments!
@weaverryan done :) |
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.
We're close - check out the test failures - I just commented about one. Another is related to needing to run vendor/bin/php-cs-fixer fix
locally to fix some phpcs stuff :)
Finally done :D |
Thank you for your hard work @Anthodev! |
It was too sloppy for my taste, i'll do better next time :p Thanks anyway @weaverryan ^^ |
Thank you for this @Anthodev ! |
Thank you @fcaraballo :) |
It's cool example, but how about moving a little further? Currently it assumes you just create account based only on access_token. Obviously most oauth2 servers will also return refresh token which is worth saving on user entity/document to be able to refresh access token in seperate logic. With this implementation only access token is avaiable in Badge context. Also I had to make change to: and replace it with:
That's because first argument of UserBadge expects string (which is taken from AccessToken toString) and fetchUserFromToken method expects and AccessToken object. |
@weaverryan left comment to PR. |
This PR was squashed before being merged into the master branch. Discussion ---------- Fixing access token, which becomes a string Renamed $credentials -> $accessToken for clarity. Also, use $accessToken from the original authenticate() method, instead of the argument that's passed to the callback, because that will have been cast into just the access token string. See: #292 (comment) Commits ------- 388f39f Fixing access token, which becomes a string
…interface
First draft for the implementation of the new authenticator interface, not sure that's really usable at the moment.