-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DX] Ability to authentication a User directly #11320
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
Conversation
$token = $this->createToken($firewallName, $user); | ||
|
||
$request = $this->requestStack->getMasterRequest(); | ||
if (!is_null($request)) { |
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.
The core always uses this instead of is_null
:
if (null !== $request) {
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.
Ahh sorry, going to fix that now!
Nice add! Just a notice, do you really need a full app to test the |
As you can see this PR is not just about LoginManager, there are also 2 new services and I think it's good to be sure that everything works as expected. |
|
||
use Symfony\Component\Security\Core\User\UserInterface; | ||
|
||
interface LoginManagerInterface |
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 don't see the need for an interface.
public function resolve($providerKey) | ||
{ | ||
$rememberMeServices = null; | ||
if ($this->serviceContainer->has('security.authentication.rememberme.services.persistent.'.$providerKey)) { |
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.
If I remember correctly these services are marked private. We also have (had?) this problem in the FOSUserBundle.
This feature is something I can see myself using. However, won't this make it easier for people to circumvent the security authentication process "because it's too complicated"? It does add "yet another way to authenticate", but is sometimes desired. 👍 For the PR |
Are there any big issues with this PR or are we getting close? Honestly, the remember me / resolver stuff is quite complex and I'm personally unsure of the side effects or the approach here. It might be perfectly sound (and so this is a good candidate to push towards merging) or there may be some fundamental issues. I see fabpot has reviewed this a bit, but I haven't see anything from the other deciders. Thanks! |
To be precise, I had a quick look at this PR, but I don't have any specific knowledge of the remember me feature. |
Maybe @schmittjoh should have a quick look at this if he’s not too busy. |
I see one big issue with this PR: It will only work with |
*/ | ||
public function loginUser($firewallName, UserInterface $user, Response $response = null) | ||
{ | ||
$this->userChecker->checkPostAuth($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.
Shouldn't the method checkPreAuth
be called previously?
Checks user preauth. Improve functional test.
@csarrazi The |
Checks that the created token is authenticated before login the user.
Closed because this PR was made into wrong branch, new PR #13062 |
Simple usage example: