Skip to content

[Security] Remember me JSON Login #17676

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

Merged

Conversation

baumerdev
Copy link
Contributor

Add block with description, how to set up remember me functionality for JSON Login

Issue symfony/symfony#40918
Pull Request symfony/symfony#48899

@carsonbot carsonbot added this to the 6.3 milestone Jan 6, 2023
@javiereguiluz javiereguiluz added the Waiting Code Merge Docs for features pending to be merged label Jan 10, 2023
@carsonbot carsonbot modified the milestones: 6.3, next Jan 10, 2023
chalasr added a commit to symfony/symfony that referenced this pull request Feb 24, 2023
…merdev, nicolas-grekas)

This PR was merged into the 6.3 branch.

Discussion
----------

[Security] Add remember me option for JSON logins

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #40918
| License       | MIT
| Doc PR        | symfony/symfony-docs#17676

This resolves the above mentioned issue by adding a `RememberMeBadge` to `JsonLoginAuthenticator` and by extending `CheckRememberMeConditionsListener` to be able to read the remember me parameter from a JSON request body (if reading from ParameterBag was unsuccessful).

This means you can send a JSON request with a body like this and needn‘t use a fallback HTTP form login when building your API:

```json
{
    "username": "dunglas",
    "password": "MyPassword",
    "_remember_me": true
}
````

Commits
-------

5fe525f [Security] Allow passing remember-me parameters via RememberMeBadge
e78461e [Security] Add remember me option for JSON logins
@javiereguiluz javiereguiluz modified the milestones: next, 6.3 Apr 11, 2023
@javiereguiluz javiereguiluz added Status: Reviewed and removed Status: Needs Review Waiting Code Merge Docs for features pending to be merged labels Apr 11, 2023
@javiereguiluz javiereguiluz merged commit 3b619b1 into symfony:6.3 Apr 11, 2023
@javiereguiluz
Copy link
Member

Markus, thanks a lot for contributing this feature and the docs for it. Congrats also on your first Symfony Docs contribution 🎉

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.

3 participants