-
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
Add simple user provider #72
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 @thewilkybarkid!
Very interesting! Could you take a quick try to add something to the docs about this? I can put any finishing touches on it :).
public function supportsClassProvider() | ||
{ | ||
yield 'OAuthUser' => [OAuthUser::class, true]; | ||
yield 'other user' => [SomeUser::class, false]; |
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.
Could you use a UserInterface
mock instead of creating the stub class below?
{ | ||
private $roles; | ||
|
||
public function __construct(array $roles = ['ROLE_USER', 'ROLE_OAUTH_USER']) |
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 noticed this wasn't actually configurable in the service. And... I'm not sure if it should be anyways :). After all, this is a helper class to make things easy... and not something the user is bound to. With this setup, they could just create their own service for this class. I'm just thinking aloud... I think like it how it is now
Had a stab at some documentation, hopefully it's clear enough but please change if not! |
Great job! I made some minor tweaks, but you made my job easy :). I appreciate you taking the time to contribute back - and hopefully you can now make your linked PR a bit simpler - I just tagged 1.16.0. |
This add a user provider that can be used for simple authentication use cases, allowing any successful OAuth to authenticate into your app without any persistence.
(This is similar to the other bundle.)