public function JwtAuth::applies in JSON Web Token Authentication (JWT) 8.0
Same name and namespace in other branches
- 8 src/Authentication/Provider/JwtAuth.php \Drupal\jwt\Authentication\Provider\JwtAuth::applies()
Checks whether suitable authentication credentials are on the request.
Parameters
\Symfony\Component\HttpFoundation\Request $request: The request object.
Return value
bool TRUE if authentication credentials suitable for this provider are on the request, FALSE otherwise.
Overrides AuthenticationProviderInterface::applies
File
- src/
Authentication/ Provider/ JwtAuth.php, line 55
Class
- JwtAuth
- JWT Authentication Provider.
Namespace
Drupal\jwt\Authentication\ProviderCode
public function applies(Request $request) {
$auth = $request->headers
->get('Authorization');
return preg_match('/^Bearer .+/', $auth);
}