# Missing \\"Authorization\\" header im Admin-Bereich

**URL:** <https://forum.shopware.com/t/missing-authorization-header-im-admin-bereich/98305>\
**Category:** Shopware 6 (German)\
**Tags:** general, administration, programming\
**Created:** [1. Februar 2023 um 11:43 UTC](https://forum.shopware.com/t/missing-authorization-header-im-admin-bereich/98305 "2023-02-01T11:43:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![marius.wang](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/marius.wang/32/19708_2.png) [@marius.wang](https://forum.shopware.com/u/marius.wang)\
**Post date:** [1. Februar 2023 um 11:43 UTC](https://forum.shopware.com/t/missing-authorization-header-im-admin-bereich/98305/1 "2023-02-01T11:43:53Z")

</div>

Ein Einloggen im Admin-Bereich ist problemlos im Localhost möglich. Checke ich dann aber die AJAX-Request, sehe ich folgende Fehlermeldung:

```auto
{
"errors": [
{
"code": "9",
"status": "401",
"title": "The resource owner or authorization server denied the request.",
"detail": "Missing \"Authorization\" header",
"meta": {
"trace": [
{
"file": "/var/www/html/vendor/league/oauth2-server/src/AuthorizationValidators/BearerTokenValidator.php",
"line": 93,
"function": "accessDenied",
"class": "League\\OAuth2\\Server\\Exception\\OAuthServerException",
"type": "::"
},
{
"file": "/var/www/html/vendor/shopware/core/Framework/Api/OAuth/BearerTokenValidator.php",
"line": 43,
"function": "validateAuthorization",
"class": "League\\OAuth2\\Server\\AuthorizationValidators\\BearerTokenValidator",
"type": "->"
},
{
"file": "/var/www/html/vendor/league/oauth2-server/src/ResourceServer.php",
"line": 84,
"function": "validateAuthorization",
"class": "Shopware\\Core\\Framework\\Api\\OAuth\\BearerTokenValidator",
"type": "->"
},
{
"file": "/var/www/html/vendor/shopware/core/Framework/Api/EventListener/Authentication/ApiAuthenticationListener.php",
"line": 105,
"function": "validateAuthenticatedRequest",
"class": "League\\OAuth2\\Server\\ResourceServer",
"type": "->"
},
{
"file": "/var/www/html/vendor/symfony/event-dispatcher/Debug/WrappedListener.php",
"line": 117,
"function": "validateRequest",
"class": "Shopware\\Core\\Framework\\Api\\EventListener\\Authentication\\ApiAuthenticationListener",
"type": "->"
},
{
"file": "/var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php",
"line": 230,
"function": "__invoke",
"class": "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener",
"type": "->"
},
{
"file": "/var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php",
"line": 59,
"function": "callListeners",
"class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
"type": "->"
},
{
"file": "/var/www/html/vendor/shopware/core/Content/Flow/Dispatching/FlowDispatcher.php",
"line": 54,
"function": "dispatch",
"class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
"type": "->"
},
{
"file": "/var/www/html/vendor/shopware/core/Framework/Webhook/WebhookDispatcher.php",
"line": 99,
"function": "dispatch",
"class": "Shopware\\Core\\Content\\Flow\\Dispatching\\FlowDispatcher",
"type": "->"
},
{
"file": "/var/www/html/vendor/shopware/core/Framework/Event/BusinessEventDispatcher.php",
"line": 53,
"function": "dispatch",
"class": "Shopware\\Core\\Framework\\Webhook\\WebhookDispatcher",
"type": "->"
},
{
"file": "/var/www/html/vendor/shopware/core/Framework/Event/NestedEventDispatcher.php",
"line": 38,
"function": "dispatch",
"class": "Shopware\\Core\\Framework\\Event\\BusinessEventDispatcher",
"type": "->"
},
{
"file": "/var/www/html/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php",
"line": 154,
"function": "dispatch",
"class": "Shopware\\Core\\Framework\\Event\\NestedEventDispatcher",
"type": "->"
},
{
"file": "/var/www/html/vendor/symfony/http-kernel/HttpKernel.php",
"line": 151,
"function": "dispatch",
"class": "Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcher",
"type": "->"
},
{
"file": "/var/www/html/vendor/symfony/http-kernel/HttpKernel.php",
"line": 75,
"function": "handleRaw",
"class": "Symfony\\Component\\HttpKernel\\HttpKernel",
"type": "->"
},
{
"file": "/var/www/html/vendor/symfony/http-kernel/Kernel.php",
"line": 202,
"function": "handle",
"class": "Symfony\\Component\\HttpKernel\\HttpKernel",
"type": "->"
},
{
"file": "/var/www/html/vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php",
"line": 86,
"function": "handle",
"class": "Symfony\\Component\\HttpKernel\\Kernel",
"type": "->"
},
{
"file": "/var/www/html/vendor/symfony/http-kernel/HttpCache/HttpCache.php",
"line": 479,
"function": "handle",
"class": "Symfony\\Component\\HttpKernel\\HttpCache\\SubRequestHandler",
"type": "::"
},
{
"file": "/var/www/html/vendor/symfony/http-kernel/HttpCache/HttpCache.php",
"line": 452,
"function": "forward",
"class": "Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache",
"type": "->"
},
{
"file": "/var/www/html/vendor/symfony/http-kernel/HttpCache/HttpCache.php",
"line": 346,
"function": "fetch",
"class": "Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache",
"type": "->"
},
{
"file": "/var/www/html/vendor/symfony/http-kernel/HttpCache/HttpCache.php",
"line": 224,
"function": "lookup",
"class": "Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache",
"type": "->"
},
{
"file": "/var/www/html/vendor/shopware/core/HttpKernel.php",
"line": 154,
"function": "handle",
"class": "Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache",
"type": "->"
},
{
"file": "/var/www/html/vendor/shopware/core/HttpKernel.php",
"line": 79,
"function": "doHandle",
"class": "Shopware\\Core\\HttpKernel",
"type": "->"
},
{
"file": "/var/www/html/public/index.php",
"line": 85,
"function": "handle",
"class": "Shopware\\Core\\HttpKernel",
"type": "->"
}
],
"file": "/var/www/html/vendor/league/oauth2-server/src/Exception/OAuthServerException.php",
"line": 243
}
}
]
}

```

Das selbe passiert auch, wenn ich nicht meine eigene Config nutze, sondern zum Beispiel docker run --rm -p 80:80 dockware/dev:latest nutze.

Ich habe schon viel probiert, kann aber nicht wirklich sagen, woher der Fehler herkommt. Nutze ein M1 Macbook, wenn das hilft.

---

<div class="post-metadata">

**Author:** ![marius.wang](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/marius.wang/32/19708_2.png) [@marius.wang](https://forum.shopware.com/u/marius.wang)\
**Post date:** [1. Februar 2023 um 16:03 UTC](https://forum.shopware.com/t/missing-authorization-header-im-admin-bereich/98305/2 "2023-02-01T16:03:21Z")

</div>

Ich habe mittlerweile mitbekommen, dass ein White Screen nach dem login auftaucht. Dort wird auch ein Token übergeben. Allerdings werde ich danach nicht weitergeleitet.

 ![Screenshot 2023-02-01 at 17.01.02](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/3X/a/1/a1b1e40d81098425281d8c60dc625942478699d3.jpeg)  
 ![Screenshot 2023-02-01 at 17.02.20](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/3X/7/5/754e95af3e84a95d8d87b1dea8a2ee65101b9c09.jpeg)

---

<div class="post-metadata">

**Author:** ![christian.wahl](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/christian.wahl/32/21287_2.png) [@christian.wahl](https://forum.shopware.com/u/christian.wahl)\
**Post date:** [14. Juli 2023 um 14:52 UTC](https://forum.shopware.com/t/missing-authorization-header-im-admin-bereich/98305/3 "2023-07-14T14:52:54Z")

</div>

Moin Marius 🙂  
wir haben gerade das gleiche Problem. Wie hast du das bei dir / euch gelöst?  
Hoffe du kannst mir weiterhelfen!

---

<div class="post-metadata">

**Author:** ![usmanmazhar51](https://avatars.discourse-cdn.com/v4/letter/u/48db29/32.png) [@usmanmazhar51](https://forum.shopware.com/u/usmanmazhar51)\
**Post date:** [30. August 2023 um 08:06 UTC](https://forum.shopware.com/t/missing-authorization-header-im-admin-bereich/98305/4 "2023-08-30T08:06:38Z")

</div>

Hi

I don’t know German or Dutch but i have the same issue and i fixed it. After login token was generated but i see blank screen and unable to see the dashboard. The issue was with the .htaccess file in public folder. please update the file. I used the following code for .htaccess file.

# BEGIN Shopware

# The directives (lines) between „# BEGIN Shopware“ and „# END Shopware“ are dynamically generated. Any changes to the directives between these markers will be overwritten.

DirectoryIndex index.php

 Options -MultiViews RewriteEngine On

```
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]

# Sets the HTTP_AUTHORIZATION header removed by Apache
RewriteCond %{HTTP:Authorization} .
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]

# If the requested filename exists, simply serve it.
# We only want to let Apache serve files and not directories.
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]

# Rewrite all other queries to the front controller.
RewriteRule ^ %{ENV:BASE}/index.php [L]

```

\<IfModule !mod\_rewrite.c\>  
  
RedirectMatch 302 ^/$ /index.php/

 Header set Content-Security-Policy "script-src 'none'" 
# END Shopware

---

<div class="post-metadata">

**Author:** ![radek.kohut](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@radek.kohut](https://forum.shopware.com/u/radek.kohut)\
**Post date:** [1. Oktober 2024 um 11:20 UTC](https://forum.shopware.com/t/missing-authorization-header-im-admin-bereich/98305/5 "2024-10-01T11:20:47Z")

</div>

We had this issue if Shopware is deployed on Apache, the solution was to add:

```auto
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

```

into .httaccess in $shopware\_installation\_path/public folder or to of httpd.conf
