1000 search results

// ... lines 1 - 13
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 16 - 66
protected function getDefaultSuccessRedirectUrl()
{
return $this->router->generate('homepage');
}
}
See Code Block in Script
// ... lines 1 - 9
use Symfony\Component\Security\Core\Security;
// ... lines 11 - 14
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 17 - 27
public function getCredentials(Request $request)
{
// ... lines 30 - 38
$data = $form->getData();
$request->getSession()->set(
Security::LAST_USERNAME,
$data['_username']
);
// ... lines 44 - 45
}
// ... lines 47 - 75
}
See Code Block in Script
// ... lines 1 - 10
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoder;
// ... lines 12 - 15
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 18 - 20
private $passwordEncoder;
public function __construct(FormFactoryInterface $formFactory, EntityManager $em, RouterInterface $router, UserPasswordEncoder $passwordEncoder)
{
// ... lines 25 - 27
$this->passwordEncoder = $passwordEncoder;
}
// ... lines 30 - 78
}
See Code Block in Script
// ... lines 1 - 15
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 18 - 58
public function checkCredentials($credentials, UserInterface $user)
{
// ... lines 61 - 62
if ($this->passwordEncoder->isPasswordValid($user, $password)) {
return true;
}
// ... lines 66 - 67
}
// ... lines 69 - 78
}
See Code Block in Script
// ... lines 1 - 2
{% block body %}
<div class="container">
<div class="row">
<div class="col-xs-12">
// ... lines 7 - 14
{{ form_start(form) }}
// ... lines 16 - 17
<button type="submit" class="btn btn-success">Login <span class="fa fa-lock"></span></button>
&nbsp;
<a href="{{ path('user_register') }}">Register</a>
{{ form_end(form) }}
</div>
</div>
</div>
{% endblock %}
See Code Block in Script
// ... lines 1 - 2
namespace AppBundle\Security;
// ... lines 4 - 11
use Symfony\Component\Security\Guard\AbstractGuardAuthenticator;
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 16 - 61
}
See Code Block in Script
// ... lines 1 - 7
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\UserProviderInterface;
// ... lines 12 - 13
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
public function getCredentials(Request $request)
{
// ... lines 18 - 30
}
public function getUser($credentials, UserProviderInterface $userProvider)
{
// TODO: Implement getUser() method.
}
public function checkCredentials($credentials, UserInterface $user)
{
// TODO: Implement checkCredentials() method.
}
public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
{
// TODO: Implement onAuthenticationFailure() method.
}
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
{
// TODO: Implement onAuthenticationSuccess() method.
}
public function supportsRememberMe()
{
// TODO: Implement supportsRememberMe() method.
}
// ... lines 57 - 61
}
See Code Block in Script
// ... lines 1 - 5
use Symfony\Component\HttpFoundation\Request;
// ... lines 7 - 8
use Symfony\Component\Security\Core\Exception\AuthenticationException;
// ... lines 10 - 13
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 16 - 57
public function start(Request $request, AuthenticationException $authException = null)
{
// TODO: Implement start() method.
}
}
See Code Block in Script
// ... lines 1 - 13
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
public function getCredentials(Request $request)
{
$extractor = new AuthorizationHeaderTokenExtractor(
'Bearer',
'Authorization'
);
// ... lines 22 - 30
}
// ... lines 32 - 61
}
See Code Block in Script
// ... lines 1 - 17
$extractor = new AuthorizationHeaderTokenExtractor(
'Bearer',
'Authorization'
);
$token = $extractor->extract($request);
// ... lines 24 - 63
See Code Block in Script
// ... lines 1 - 17
$extractor = new AuthorizationHeaderTokenExtractor(
'Bearer',
'Authorization'
);
$token = $extractor->extract($request);
if (!$token) {
return;
}
// ... lines 28 - 63
See Code Block in Script
// ... lines 1 - 17
$extractor = new AuthorizationHeaderTokenExtractor(
'Bearer',
'Authorization'
);
$token = $extractor->extract($request);
if (!$token) {
return;
}
return $token;
// ... lines 30 - 63
See Code Block in Script
// ... lines 1 - 16
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 19 - 21
public function __construct(JWTEncoderInterface $jwtEncoder, EntityManager $em)
{
// ... lines 24 - 25
}
// ... lines 27 - 82
}
See Code Block in Script
// ... lines 1 - 16
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
private $jwtEncoder;
private $em;
public function __construct(JWTEncoderInterface $jwtEncoder, EntityManager $em)
{
$this->jwtEncoder = $jwtEncoder;
$this->em = $em;
}
// ... lines 27 - 82
}
See Code Block in Script
// ... lines 1 - 16
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 19 - 43
public function getUser($credentials, UserProviderInterface $userProvider)
{
$data = $this->jwtEncoder->decode($credentials);
// ... lines 47 - 56
}
// ... lines 58 - 82
}
See Code Block in Script
// ... lines 1 - 45
$data = $this->jwtEncoder->decode($credentials);
if ($data === false) {
throw new CustomUserMessageAuthenticationException('Invalid Token');
}
// ... lines 51 - 84
See Code Block in Script
// ... lines 1 - 45
$data = $this->jwtEncoder->decode($credentials);
if ($data === false) {
throw new CustomUserMessageAuthenticationException('Invalid Token');
}
$username = $data['username'];
// ... lines 53 - 84
See Code Block in Script
// ... lines 1 - 45
$data = $this->jwtEncoder->decode($credentials);
if ($data === false) {
throw new CustomUserMessageAuthenticationException('Invalid Token');
}
$username = $data['username'];
return $this->em
->getRepository('AppBundle:User')
->findOneBy(['username' => $username]);
// ... lines 57 - 84
See Code Block in Script
// ... lines 1 - 16
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 19 - 58
public function checkCredentials($credentials, UserInterface $user)
{
return true;
}
// ... lines 63 - 82
}
See Code Block in Script
// ... lines 1 - 16
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 19 - 63
public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
{
}
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
{
// do nothing - let the controller be called
}
// ... lines 73 - 82
}
See Code Block in Script