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

Open
russmenum opened this issue Nov 14, 2023 · 0 comments
Open

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

russmenum opened this issue Nov 14, 2023 · 0 comments

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

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

1 participant