1000 search results

// ... lines 1 - 17
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 20 - 79
public function start(Request $request, AuthenticationException $authException = null)
{
// called when authentication info is missing from a
// request that requires it
return new JsonResponse([
'error' => 'auth required'
], 401);
}
}
See Code Block in Script
// ... lines 1 - 16
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 19 - 73
public function supportsRememberMe()
{
return false;
}
// ... lines 78 - 82
}
See Code Block in Script
// ... lines 1 - 17
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 20 - 79
public function start(Request $request, AuthenticationException $authException = null)
{
// called when authentication info is missing from a
// request that requires it
return new JsonResponse([
'error' => 'auth required'
], 401);
}
}
See Code Block in Script
// ... lines 1 - 18
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 21 - 80
public function start(Request $request, AuthenticationException $authException = null)
{
// called when authentication info is missing from a
// request that requires it
$apiProblem = new ApiProblem(401);
// ... lines 87 - 91
}
}
See Code Block in Script
// ... lines 1 - 18
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 21 - 80
public function start(Request $request, AuthenticationException $authException = null)
{
// called when authentication info is missing from a
// request that requires it
$apiProblem = new ApiProblem(401);
// you could translate this
$message = $authException ? $authException->getMessageKey() : 'Missing credentials';
// ... lines 89 - 91
}
}
See Code Block in Script
// ... lines 1 - 82
// called when authentication info is missing from a
// request that requires it
$apiProblem = new ApiProblem(401);
// you could translate this
$message = $authException ? $authException->getMessageKey() : 'Missing credentials';
$apiProblem->set('detail', $message);
// ... lines 90 - 94
See Code Block in Script
// ... lines 1 - 18
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 21 - 80
public function start(Request $request, AuthenticationException $authException = null)
{
// called when authentication info is missing from a
// request that requires it
$apiProblem = new ApiProblem(401);
// you could translate this
$message = $authException ? $authException->getMessageKey() : 'Missing credentials';
$apiProblem->set('detail', $message);
return new JsonResponse($apiProblem->toArray(), 401);
}
}
See Code Block in Script
// ... lines 1 - 19
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 22 - 23
private $responseFactory;
public function __construct(JWTEncoderInterface $jwtEncoder, EntityManager $em, ResponseFactory $responseFactory)
{
// ... lines 28 - 29
$this->responseFactory = $responseFactory;
}
// ... lines 32 - 95
}
See Code Block in Script
// ... lines 1 - 19
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 22 - 83
public function start(Request $request, AuthenticationException $authException = null)
{
// ... lines 86 - 93
return $this->responseFactory->createResponse($apiProblem);
}
}
See Code Block in Script
// ... lines 1 - 19
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 22 - 83
public function start(Request $request, AuthenticationException $authException = null)
{
// ... lines 86 - 91
$apiProblem->set('detail', $message);
// ... lines 93 - 94
}
}
See Code Block in Script
// ... lines 1 - 19
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 22 - 83
public function start(Request $request, AuthenticationException $authException = null)
{
// ... lines 86 - 94
}
}
See Code Block in Script
// ... lines 1 - 19
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 22 - 68
public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
{
}
// ... lines 73 - 95
}
See Code Block in Script
// ... lines 1 - 19
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 22 - 68
public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
{
return new JsonResponse('Hello!', 401);
}
// ... lines 73 - 95
}
See Code Block in Script
// ... lines 1 - 19
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 22 - 68
public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
{
$apiProblem = new ApiProblem(401);
// ... lines 72 - 75
}
// ... lines 77 - 99
}
See Code Block in Script
// ... lines 1 - 70
$apiProblem = new ApiProblem(401);
// you could translate this
$apiProblem->set('detail', $exception->getMessageKey());
// ... lines 74 - 101
See Code Block in Script
// ... lines 1 - 70
$apiProblem = new ApiProblem(401);
// you could translate this
$apiProblem->set('detail', $exception->getMessageKey());
return $this->responseFactory->createResponse($apiProblem);
// ... lines 76 - 101
See Code Block in Script
// ... lines 1 - 19
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 22 - 48
public function getUser($credentials, UserProviderInterface $userProvider)
{
$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 63 - 99
}
See Code Block in Script
// ... lines 1 - 2
namespace AppBundle\Security;
// ... lines 4 - 10
use Symfony\Component\Security\Guard\AbstractGuardAuthenticator;
class WeirdFormAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 15 - 42
}
See Code Block in Script
// ... lines 1 - 4
use Symfony\Component\HttpFoundation\Request;
// ... line 6
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 11 - 12
class WeirdFormAuthenticator extends AbstractGuardAuthenticator
{
public function getCredentials(Request $request)
{
}
public function getUser($credentials, UserProviderInterface $userProvider)
{
}
public function checkCredentials($credentials, UserInterface $user)
{
}
public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
{
}
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
{
}
public function supportsRememberMe()
{
}
public function start(Request $request, AuthenticationException $authException = null)
{
}
}
See Code Block in Script
// ... lines 1 - 28
public function getCredentials(Request $request)
{
if ($request->getPathInfo() != '/login' || !$request->isMethod('POST')) {
return;
}
// ... lines 34 - 40
}
// ... lines 42 - 101
See Code Block in Script