Closed
Description
In src/Application.php
$service->loadAuthenticator('Authentication.Token', [
'header' => 'X-Dipper-Auth',
'tokenPrefix' => 'dipper_',
]);
Testing like this:
$ curl --verbose -H 'X-Dipper-Auth: dipper_sdfasdfadsf' https://domain.com/
dipper_
is the token prefix. It is not being stripped before being passed to my identifier. Looking at the code in vendor/cakephp/authentication/src/Authenticator/TokenAuthenticator.php
, I found the function stripTokenPrefix()
which does something odd:
return str_ireplace($prefix . ' ', '', $token);
Why is the replace concatenated with an empty space? That's not part of my prefix.