Call to a member function getIdentifier() on null

In controller:

$identity=$this->Authentication->getIdentity()->getIdentifier();
dd($identity);

I have got error:

Call to a member function getIdentifier() on null

Following this: https://book.cakephp.org/authentication/2/en/identity-object.html
How can I solve this problem?

Have you actually loaded the component, per https://book.cakephp.org/authentication/2/en/authentication-component.html?