Skip to content

Conversation

@weaverryan
Copy link
Member

Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no (but minor behavior change)
Deprecations? no->
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR not needed

This is an edge-case bug fix. If, for example, someone tampers with the remember me cookie, and so it is invalid, this causes the ->autoLogin() call to throw an AuthenticationException. But, this did not call the loginFail() method.

Honestly, I'm not sure if the old or new behavior is correct. But, we should discuss and merge or close.

}

return;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at the rest of this method for full context. The new code basically tries to treat a failure from autoLogin just like the failure below. I only didn't move the call into the try-catch, so that we could have slightly different log messages.

@linaori
Copy link
Contributor

linaori commented May 18, 2018

As a remember me doesn't have an actual authentication attempt, but only refreshes, I think it's safe to assume that all behavior should be consistent for a refresh. If that means that in this scenario the loginfail was not triggered, it probably should be.

@nicolas-grekas nicolas-grekas added this to the 2.7 milestone May 18, 2018
@fabpot
Copy link
Member

fabpot commented May 27, 2018

merging into 2.8 as 2.7 is not maintained anymore.

@fabpot fabpot changed the base branch from 2.7 to 2.8 May 27, 2018 07:16
@fabpot fabpot force-pushed the remember_me_login_fail branch from 924e381 to e3412e6 Compare May 27, 2018 07:16
@fabpot
Copy link
Member

fabpot commented May 27, 2018

Thank you @weaverryan.

@fabpot fabpot merged commit e3412e6 into symfony:2.8 May 27, 2018
fabpot added a commit that referenced this pull request May 27, 2018
…reated (weaverryan)

This PR was submitted for the 2.7 branch but it was merged into the 2.8 branch instead (closes #27297).

Discussion
----------

Triggering RememberMe's loginFail() when token cannot be created

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no (but minor behavior change)
| Deprecations? | no->
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | not needed

This is an edge-case bug fix. If, for example, someone tampers with the remember me cookie, and so it is invalid, this causes the `->autoLogin()` call to throw an `AuthenticationException`. But, this did not call the `loginFail()` method.

Honestly, I'm not sure if the old or new behavior is correct. But, we should discuss and merge or close.

Commits
-------

e3412e6 Triggering RememberMe's loginFail() when token cannot be created
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants