Is there way way to load the token from Cookie?
russmenum opened this issue · comments
russmenum commented
in src/Controller/AppController.php
$this->loadComponent('Auth', [
'storage' => 'Memory',
'authenticate' => [
'Form' => [
'scope' => ['Users.active' => 1]
],
'ADmad/JwtAuth.Jwt' => [
'parameter' => 'token',
'userModel' => 'Users',
'scope' => ['Users.active' => 1],
'fields' => [
'username' => 'id'
],
'queryDatasource' => true
]
],
'unauthorizedRedirect' => false,//meed to == ?true for CAKELOG IN? ELSE == ?FALSE
'checkAuthIn' => 'Controller.initialize'
]);
works fine so long as the HEADER has "Authorization", `Bearer ${token}
, but for HTTP requests you can not apend the REQ header like this, you can send the value in the cookies, but I am lost where you would do a IF not in header LOOK for valule in a cookie...
The result is not web views can be secure because you can not pass the token by header and can not read it by cookie