Questions about 4.x branch of the CakePHP MVC framework. Use this tag in combination with the general [cakephp] tag. If your question applies to CakePHP more generally, use only the [cakephp] tag.
Questions tagged [cakephp-4.x]
511 questions
0
votes
2 answers
CakePHP 4 manually log in user
I'm trying to manually sign in a user.
Previously this was done calling $this->Auth->login()
I can't find how to do it using the Authentication plugin.

Robin.v
- 719
- 3
- 8
- 16
0
votes
1 answer
Why is the callback identifier not being invoked?
I'm trying to implement matching a Kerberos authentication with a local user database in CakePHP4. So I installed CakePHP 4 and the Authentication plugin 2.0. Since Kerberos auth is managed by our IIS WebServer, only thing I have to do is check if…

Aru
- 31
- 6
0
votes
1 answer
Cakephp 4 Form Helper: Create Individual dropdown for day, month and year
So, in CakePHP 3, to get something like this:
I would do this:
= $this->Form->date('dob', [
'templates' => ['inputContainer' => '{{content}}'], 'label' => false, 'class' => 'form-control', 'minYear' => 1940, 'maxYear' => date('Y') - 5,
…

degee147
- 255
- 2
- 5
- 14
0
votes
2 answers
CakePHP4 not showing or logging fatal error
I have deployed my app to the server, and on refreshing the home page I get the generic "An error has occurred " page with no details.
There is no corresponding entry in the error.log
There is not corresponding entry in…

Will
- 4,498
- 2
- 38
- 65
0
votes
1 answer
Why does the auth component access the `users` table, despite me not using a model named `Users`?
I'm using cakephp 4 and when I'm trying to login a User it says me there was no table called Users. But I used "Users" nowhere in my code, only "User" without the "s".
I don't find the bug and how to resolve it.

Pedrix09X
- 3
- 1
0
votes
0 answers
How to add a config parameter inside a translation value in CakePHP 4
We have a config file for our CAKEPHP app and we want to add there some "tags" so our translation team dont have to change the customer name always. In a prior iteration of our app using CakePHP2 what we did was override in basics.php the definition…

Khel_MVA
- 48
- 5
0
votes
1 answer
Is there an extension for Active Directory authentication for CakePHP 4.X?
I've been requested to start porting our internal tools to CakePHP 4 (from a variety of CakePHP 2.X and 3.X). One of the items on my checklist that is missing is a library to enable authentication against an MS Active directory.
I am currently…

Dan Gaudreault
- 13
- 4
0
votes
1 answer
PHPUnit CakePHP 4.X - mock up the identity object, but how?
i written a webaplication with cakephp 4.x. In my controller(AppController.php) i have implements the following:
...
public function beforeRender(\Cake\Event\EventInterface $event)
{
#Load User_ID
if($this->Authentication->getIdentity()){
…

ProfDaniBest
- 5
- 3
0
votes
0 answers
Cakephp 4 Slug Generation
I have a problem. I'm building a CMS in Cakephp based on the guide on their official website. Everything is going well but I have a problem.
As the article adds, no service is generated.
Everything is 100% done as per the tutorial.
Can you guess…

l3nox
- 15
- 2
- 8
0
votes
0 answers
Chained Select CakePHP4
I'm trying to create a chained select dropdown list in CakePHP 4. I've search several forum and found few solution and it is found that they are work with previous CakePHP version. I've follow the codes from CakePHP 4 Sandbox which is good sample…

Foggies
- 1
- 1
0
votes
1 answer
Why do AJAX requests trigger a 400 response despite unlocking the actions with the security component?
I'm trying to get an ajax request working in CakePHP4, but keep running into the CSRF protection.
In my controller:
public function beforeFilter(EventInterface $event)
{
parent::beforeFilter($event);
…

PaulH
- 52
- 7
0
votes
1 answer
CakePHP TinyAuth Adapter Implementation
I'm using TinyAuth CakePHP plugin to manage permissions on my website.
They also have a plugin to manage the ACL (access control list) using a Database with CakePHP 3.7+, but the plugin isn't working with CakePHP 4.0
I'm currently writing custom…
user13686470
0
votes
0 answers
How to enforce redirect from Subclass in Cakephp
I want to authenticate against Keycloak from a Cake app using the Auth-Middleware. I mocked it in AppController which worked out well, and I am pretty sure that it's going to work with the middleware as well. I wrote 2 new Authenticator and 1…

harpax
- 5,986
- 5
- 35
- 49
0
votes
1 answer
CakePHP how to validate CSRF token?
I am using cakephp version 4, Here I have added csrf in middleware.
use Cake\Http\Middleware\CsrfProtectionMiddleware;
public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue
{
$csrf = new CsrfProtectionMiddleware();
…

Niloy Rony
- 602
- 1
- 8
- 23
0
votes
1 answer
Cakephp 4 Method "session()" does not exist
I have an issue related to session in cakephp 4 , it return "session doesnt exist" , the same function work well in cakephp 3 , I checked the cookbook and didn't find any new changes about the Session.
$session = $this->request->session();
$name =…

devlogi
- 43
- 1
- 12