1000 search results

// ... 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
// ... 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