Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there way way to load the token from Cookie? #545

Closed
russmenum opened this issue Nov 14, 2023 · 1 comment
Closed

Is there way way to load the token from Cookie? #545

russmenum opened this issue Nov 14, 2023 · 1 comment

Comments

@russmenum
Copy link

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

@bshaffer
Copy link
Collaborator

This looks like a question for Laravel or Symfony - the function loadComponent does not exist in this library, nor do any of the options you are providing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants