# Help Authentication

**URL:** <https://discourse.cakephp.org/t/help-authentication/9472>\
**Category:** Need Help\
**Tags:** help\
**Created:** [July 1, 2021, 10:15am UTC](https://discourse.cakephp.org/t/help-authentication/9472 "2021-07-01T10:15:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BuBulle](https://avatars.discourse-cdn.com/v4/letter/b/ecb155/32.png) [@BuBulle](https://discourse.cakephp.org/u/BuBulle)\
**Post date:** [July 1, 2021, 10:15am UTC](https://discourse.cakephp.org/t/help-authentication/9472/1 "2021-07-01T10:15:20Z")

</div>

Hello,

My problem is ‘AuthenticationServiceProviderInterface’.

I installed ‘cakephp/authentication’ with composer but without success.

Can you help me?

Thanks

---

<div class="post-metadata">

**Author:** ![spadeX](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@spadeX](https://discourse.cakephp.org/u/spadeX)\
**Post date:** [July 1, 2021, 12:03pm UTC](https://discourse.cakephp.org/t/help-authentication/9472/2 "2021-07-01T12:03:17Z")

</div>

I think you didn’t installed properly or not follows the all steps in documentation.

---

<div class="post-metadata">

**Author:** ![BuBulle](https://avatars.discourse-cdn.com/v4/letter/b/ecb155/32.png) [@BuBulle](https://discourse.cakephp.org/u/BuBulle)\
**Post date:** [July 1, 2021, 12:40pm UTC](https://discourse.cakephp.org/t/help-authentication/9472/3 "2021-07-01T12:40:40Z")

</div>

I followed each step of the tutorial in the documentation, authentication seems to be well installed (it is in the composer.json).

Unable to load component in file: AppController.php.

I don’t understand…

---

<div class="post-metadata">

**Author:** ![cnizzardini](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/cnizzardini/32/2221_2.png) [@cnizzardini](https://discourse.cakephp.org/u/cnizzardini)\
**Post date:** [July 1, 2021, 1:27pm UTC](https://discourse.cakephp.org/t/help-authentication/9472/4 "2021-07-01T13:27:14Z")

</div>

Can you provide an error or more insight?

I’m using this with success in a Plugin.php, your bootstrap for Application.php will be similar enough:

```auto
    public function bootstrap(PluginApplicationInterface $app): void
    {
        parent::bootstrap($app);

        $app->addPlugin('Authentication');
    }

```

```auto
   public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue
    {
        $middlewareQueue->add(new AuthenticationMiddleware($this));

        return $middlewareQueue;
    }

```

```auto
    public function getAuthenticationService(ServerRequestInterface $request): AuthenticationServiceInterface
    {
        $service = new AuthenticationService();
        $service->loadAuthenticator('Authentication.Token', [
            'header' => 'API-KEY',
        ]);

        // Load identifiers
        $service->loadIdentifier('Authentication.Token',[
            'resolver' => 'AdminApi\Identifier\Resolver\CustomResolver'
        ]);

        return $service;
    }

```
