# Shopware 5.4.5 - Backend Fehler The provided CSRF-Token is invalid

**URL:** <https://forum.shopware.com/t/shopware-5-4-5-backend-fehler-the-provided-csrf-token-is-invalid/54261>\
**Category:** Administration\
**Created:** [25. Juli 2018 um 05:14 UTC](https://forum.shopware.com/t/shopware-5-4-5-backend-fehler-the-provided-csrf-token-is-invalid/54261 "2018-07-25T05:14:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Str33tfight3r](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@Str33tfight3r](https://forum.shopware.com/u/Str33tfight3r)\
**Post date:** [25. Juli 2018 um 05:14 UTC](https://forum.shopware.com/t/shopware-5-4-5-backend-fehler-the-provided-csrf-token-is-invalid/54261/1 "2018-07-25T05:14:08Z")

</div>

Hallo,

ich bekomme seit heute morgen folgende Meldung sobald ich versuche das Backend zu öffnen:

Modul:&nbsp;Shopware.apps  
Pfad der Anforderung: /backend/  
HTTP-Fehlermeldung:&nbsp;Bad Request  
HTTP-Statuscode:&nbsp;400 / GET

&nbsp;

```
Ups! Ein Fehler ist aufgetreten!

Die nachfolgenden Hinweise sollten Ihnen weiterhelfen.

The provided CSRF-Token is invalid. If you're sure that the request to path "/backend/Login?file=app&no-cache=1532089906" should be valid, the called controller action needs to be whitelisted using the CSRFWhitelistAware interface. in engine/Shopware/Components/CSRFTokenValidator.php on line 109
Stack trace:

#0 [internal function]: Shopware\Components\CSRFTokenValidator->checkBackendTokenValidation(Object(Enlight_Controller_ActionEventArgs))
#1 engine/Library/Enlight/Event/Handler/Default.php(91): call_user_func(Array, Object(Enlight_Controller_ActionEventArgs))
#2 engine/Library/Enlight/Event/EventManager.php(220): Enlight_Event_Handler_Default->execute(Object(Enlight_Controller_ActionEventArgs))
#3 engine/Library/Enlight/Controller/Action.php(177): Enlight_Event_EventManager->notify('Enlight_Control...', Object(Enlight_Controller_ActionEventArgs))
#4 engine/Library/Enlight/Controller/Dispatcher/Default.php(549): Enlight_Controller_Action->dispatch('indexAction')
#5 engine/Library/Enlight/Controller/Front.php(222): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp))
#6 engine/Shopware/Kernel.php(215): Enlight_Controller_Front->dispatch()
#7 vendor/symfony/http-kernel/HttpCache/HttpCache.php(486): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#8 engine/Shopware/Components/HttpCache/AppCache.php(268): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL)
#9 vendor/symfony/http-kernel/HttpCache/HttpCache.php(253): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true)
#10 engine/Shopware/Components/HttpCache/AppCache.php(105): Symfony\Component\HttpKernel\HttpCache\HttpCache->pass(Object(Symfony\Component\HttpFoundation\Request), true)
#11 shopware.php(122): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request))
#12 {main}

```

Jetzt habe ich im Dev gelesen, dass man das Token „einfach“ in der config.php deaktivieren kann.  
Anderen Webseiten zufolge hat man dann aber vermehrt Spam usw. gibt es schon eine neue Lösung des Problems?

config.php

```
...
'csrfProtection' => [
    'frontend' => false,
    'backend' => false
],
...

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![Moritz\_Naczenski](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/moritz_naczenski/32/7792_2.png) [@Moritz\_Naczenski](https://forum.shopware.com/u/Moritz_Naczenski)\
**Post date:** [25. Juli 2018 um 05:15 UTC](https://forum.shopware.com/t/shopware-5-4-5-backend-fehler-the-provided-csrf-token-is-invalid/54261/2 "2018-07-25T05:15:56Z")

</div>

Browser Cache komplett leeren oder mal anderen Browser nutzen. Abschalten ist keine gute Lösung&nbsp;

---

<div class="post-metadata">

**Author:** ![sonic](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/sonic/32/25728_2.png) [@sonic](https://forum.shopware.com/u/sonic)\
**Post date:** [25. Juli 2018 um 06:36 UTC](https://forum.shopware.com/t/shopware-5-4-5-backend-fehler-the-provided-csrf-token-is-invalid/54261/3 "2018-07-25T06:36:58Z")

</div>

Habe ich in einem Shop auch immer wieder - da hilft tatsächlich ENTWEDER per FTP/Console&nbsp;den ganzen Shop-Cache zu löschen, ODER den Browser-Cache zu leeren!  
Da bleibt aus welchem Grund auch immer, immer wieder ein&nbsp;alter Token im **Browser-Cache** hängen - da kansst Du reloaden, bist Du blöd wirst ![Angry-Face](https://forum.shopware.com/plugins/CKEditor/plugins/smiley/images/angry-face.png "Angry-Face")!

---

<div class="post-metadata">

**Author:** ![rissland2](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@rissland2](https://forum.shopware.com/u/rissland2)\
**Post date:** [12. Dezember 2020 um 09:17 UTC](https://forum.shopware.com/t/shopware-5-4-5-backend-fehler-the-provided-csrf-token-is-invalid/54261/4 "2020-12-12T09:17:43Z")

</div>

Gibt es da jetzt eigentlich mal von Shopware eine Lösung? Das tritt bei uns an mehreren Rechnern ständig auf. Das nervt etwas

---

<div class="post-metadata">

**Author:** ![Rico89](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@Rico89](https://forum.shopware.com/u/Rico89)\
**Post date:** [22. Juni 2021 um 09:04 UTC](https://forum.shopware.com/t/shopware-5-4-5-backend-fehler-the-provided-csrf-token-is-invalid/54261/5 "2021-06-22T09:04:32Z")

</div>

Hi,  
falls es noch relevant ist:  
Du musst diene Actions whitelisten:

Der Controller benötigt ein Interface:  
`implements \Shopware\Components\CSRFWhitelistAware`

und die Funktion

```auto
    public function getWhitelistedCSRFActions()
    {
        return [
            'index'
        ];
    }

```

In das Array gibst du alle Actions als String rein (ohne ‚Action‘)
