1000 search results

32 lines | app/config/security.yml
security:
// ... lines 2 - 8
firewalls:
main:
// ... lines 11 - 20
guard:
authenticators:
- 'jwt_token_authenticator'
// ... lines 24 - 32
See Code Block in Script
32 lines | app/config/security.yml
security:
// ... lines 2 - 8
firewalls:
main:
pattern: ^/
anonymous: true
form_login:
# The route name that the login form submits to
check_path: security_login_check
login_path: security_login_form
logout:
# The route name the user can go to in order to logout
path: security_logout
guard:
authenticators:
- 'jwt_token_authenticator'
// ... lines 24 - 32
See Code Block in Script
32 lines | app/config/security.yml
security:
// ... lines 2 - 8
firewalls:
main:
// ... lines 11 - 12
form_login:
# The route name that the login form submits to
check_path: security_login_check
login_path: security_login_form
// ... lines 17 - 32
See Code Block in Script
36 lines | app/config/security.yml
security:
// ... lines 2 - 8
firewalls:
api:
pattern: ^/api/
// ... lines 12 - 36
See Code Block in Script
36 lines | app/config/security.yml
security:
// ... lines 2 - 8
firewalls:
api:
pattern: ^/api/
anonymous: true
stateless: true
// ... lines 14 - 36
See Code Block in Script
36 lines | app/config/security.yml
security:
// ... lines 2 - 8
firewalls:
api:
pattern: ^/api/
anonymous: true
stateless: true
guard:
authenticators:
- 'jwt_token_authenticator'
main:
pattern: ^/
anonymous: true
form_login:
# The route name that the login form submits to
check_path: security_login_check
login_path: security_login_form
logout:
# The route name the user can go to in order to logout
path: security_logout
// ... lines 28 - 36
See Code Block in Script
31 lines | app/config/security.yml
// ... lines 1 - 2
security:
// ... lines 4 - 5
providers:
my_entity_users:
entity:
class: AppBundle:User
// ... lines 10 - 31
See Code Block in Script
31 lines | app/config/security.yml
// ... lines 1 - 2
security:
// ... lines 4 - 10
firewalls:
// ... lines 12 - 16
main:
anonymous: ~
// ... lines 19 - 21
guard:
authenticators:
- weird_authenticator
// ... lines 25 - 31
See Code Block in Script
62 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 18
final class LoginFormAuthenticator extends AbstractLoginFormAuthenticator
{
// ... lines 21 - 44
public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response
{
if ($targetPath = $request->query->get('_target_path')) {
return new RedirectResponse($targetPath);
}
// ... lines 50 - 54
}
// ... lines 56 - 60
}
See Code Block in Script
16 lines | templates/security/enable2fa.html.twig
{% extends 'base.html.twig' %}
{% block title %}2fa Activation{% endblock %}
{% block body %}
<div class="container">
<div class="row">
<div class="login-form bg-light mt-4 p-4">
<h1 class="h3 mb-3 font-weight-normal">Use Authy or Google Authenticator to Scan the QR Code</h1>
// ... lines 10 - 11
</div>
</div>
</div>
{% endblock %}
See Code Block in Script
{% extends 'base.html.twig' %}
{% block title %}2fa Activation{% endblock %}
{% block body %}
<div class="container">
<div class="row">
<div class="login-form bg-light mt-4 p-4">
<h1 class="h3 mb-3 font-weight-normal">Use Authy or Google Authenticator to Scan the QR Code</h1>
<img src="{{ path('app_qr_code') }}" alt="2fa QR Code">
</div>
</div>
</div>
{% endblock %}
See Code Block in Script
138 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 26
use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
// ... lines 28 - 29
class LoginFormAuthenticator extends AbstractLoginFormAuthenticator
{
// ... lines 32 - 39
public function authenticate(Request $request): Passport
{
// ... lines 42 - 66
}
// ... lines 68 - 136
}
See Code Block in Script
138 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 39
public function authenticate(Request $request): Passport
{
$email = $request->request->get('email');
$password = $request->request->get('password');
return new Passport(
// ... lines 46 - 65
);
}
// ... lines 68 - 138
See Code Block in Script
138 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 39
public function authenticate(Request $request): Passport
{
// ... lines 42 - 44
return new Passport(
new UserBadge($email, function($userIdentifier) {
// optionally pass a callback to load the User manually
$user = $this->entityManager
->getRepository(User::class)
->findOneBy(['email' => $userIdentifier]);
if (!$user) {
throw new UserNotFoundException();
}
return $user;
}),
// ... lines 58 - 65
);
}
// ... lines 68 - 138
See Code Block in Script
138 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 39
public function authenticate(Request $request): Passport
{
// ... lines 42 - 44
return new Passport(
new UserBadge($email, function($userIdentifier) {
// ... lines 47 - 56
}),
new PasswordCredentials($password),
// ... lines 59 - 65
);
}
// ... lines 68 - 138
See Code Block in Script
138 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 39
public function authenticate(Request $request): Passport
{
// ... lines 42 - 44
return new Passport(
// ... lines 46 - 57
new PasswordCredentials($password),
[
new CsrfTokenBadge(
'authenticate',
$request->request->get('_csrf_token')
),
// ... line 64
]
);
}
// ... lines 68 - 138
See Code Block in Script
138 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 39
public function authenticate(Request $request): Passport
{
// ... lines 42 - 44
return new Passport(
// ... lines 46 - 57
new PasswordCredentials($password),
[
// ... lines 60 - 63
(new RememberMeBadge())->enable(),
]
);
}
// ... lines 68 - 138
See Code Block in Script
87 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 28
public function __construct(private SessionInterface $session, private EntityManagerInterface $entityManager, private UrlGeneratorInterface $urlGenerator)
{
}
// ... lines 32 - 87
See Code Block in Script
45 lines | src/Security/Voter/DragonTreasureVoter.php
// ... lines 1 - 8
class DragonTreasureVoter extends Voter
{
// ... lines 11 - 13
protected function supports(string $attribute, mixed $subject): bool
{
// ... lines 16 - 19
}
// ... lines 21 - 43
}
See Code Block in Script
40 lines | src/Security/Voter/DragonTreasureVoter.php
// ... lines 1 - 9
class DragonTreasureVoter extends Voter
{
public const EDIT = 'EDIT';
protected function supports(string $attribute, mixed $subject): bool
{
return in_array($attribute, [self::EDIT])
&& $subject instanceof DragonTreasure;
}
// ... lines 19 - 38
}
See Code Block in Script