mixed|null getCredentials(Request $request)
Get the authentication credentials from the request and return them as any type (e.g. an associate array). If you return null, authentication will be skipped.
Whatever value you return here will be passed to getUser() and checkCredentials()
For example, for a form login, you might:
if ($request->request->has('_username')) {
return array(
'username' => $request->request->get('_username'),
'password' => $request->request->get('_password'),
);
} else {
return;
}
Or for an API token that's on a header, you might use:
return array('api_key' => $request->headers->get('X-API-TOKEN'));
Please login to continue.