8000 [Security] Huge Overhaul of all security by weaverryan · Pull Request #10423 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[Security] Huge Overhaul of all security #10423

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
merged 5 commits into from
Oct 18, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tweaks based on feedback
  • Loading branch information
weaverryan committed Oct 18, 2018
commit 3e63a6ce9687559810e780b2842a4e0590db8b48
6 changes: 6 additions & 0 deletions security/user_checkers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ are not met, an exception should be thrown which extends the
use App\Exception\AccountDeletedException;
use App\Security\User as AppUser;
use Symfony\Component\Security\Core\Exception\AccountExpiredException;
use Symfony\Component\Security\Core\Exception\CustomUserMessageAuthenticationException;
use Symfony\Component\Security\Core\User\UserCheckerInterface;
use Symfony\Component\Security\Core\User\UserInterface;

Expand All @@ -39,6 +40,11 @@ are not met, an exception should be thrown which extends the
// user is deleted, show a generic Account Not Found message.
if ($user->isDeleted()) {
throw new AccountDeletedException('...');

// or to customize the message shown
throw new CustomUserMessageAuthenticationException(
'Your account was deleted. Sorry about that!'
);
}
}

Expand Down
4 changes: 2 additions & 2 deletions security/user_provider.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ User providers are configured in ``config/packages/security.yaml`` under the
memory:
# custom options for that provider
users:
user: { password: userpass, roles: [ 'ROLE_USER' ] }
admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
user: { password: '%env(USER_PASSWORD)%', roles: [ 'ROLE_USER' ] }
admin: { password: '%env(ADMIN_PASSWORD)%', roles: [ 'ROLE_ADMIN' ] }

a_chain_provider:
chain:
Expand Down
0