# \[Solved\] Nach Installation Login Probleme / Access Probleme API, auch mit BasicAuth

**URL:** <https://forum.shopware.com/t/solved-nach-installation-login-probleme-access-probleme-api-auch-mit-basicauth/63404>\
**Category:** Installation / Einstieg\
**Created:** [6. Dezember 2019 um 22:07 UTC](https://forum.shopware.com/t/solved-nach-installation-login-probleme-access-probleme-api-auch-mit-basicauth/63404 "2019-12-06T22:07:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![benblub](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@benblub](https://forum.shopware.com/u/benblub)\
**Post date:** [6. Dezember 2019 um 22:07 UTC](https://forum.shopware.com/t/solved-nach-installation-login-probleme-access-probleme-api-auch-mit-basicauth/63404/1 "2019-12-06T22:07:02Z")

</div>

Umgebung: Shared Hosting Ubuntu, zip hochgeladen entpacked document root auf public gesetzt und installer gefolgt. Installation erfolgreich abgeschlossen…

Wie in den docs beschrieben hatte ich Probleme mich ins Admin einzuloggen.

> Achte darauf dass ein .htaccess Schutz in der Early Access 1.1 dazu führt, dass der Admin unter Umständen nicht mehr geöffnet werden kann.

[https://docs.shopware.com/de/shopware-6-de/erste-schritte/shopware-6-installieren?category=shopware-6-de/erste-schritte](https://docs.shopware.com/de/shopware-6-de/erste-schritte/shopware-6-installieren?category=shopware-6-de/erste-schritte)

Ich habe dann wie empfohlen ein BasicAuth eingerichtet mit htaccess und htpasswd welches für ein Testfile auch Problemlos funktioniert. Beim aufrufen der Shopware API bekomme ich folgenden Fehler:

> {„errors“:[{„code“:„9“,„status“:„401“,„title“:„The resource owner or authorization server denied the request.“,„detail“:„The JWT string must have two dots“}]}

Beim login /admin wenn ich meine Credentials eingebe kommt die BasicAuth Abfrage immer wieder erneut im Loop.

Hier noch mit .htaccess

```
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]

    
        RedirectMatch 302 ^/$ /index.php/
    

	AuthType Basic
	AuthName "Authentication Required"
	AuthUserFile "PFAD_ZUM_HTPASSWD_FILE"
	Require valid-user

	Order allow,deny
	Allow from all

```

Achja wenn ich diesen Teil aus den Docs mit reinehme…

```
    Require expr %{THE_REQUEST} =~ m#.*?\s+\/api.*?#
    Require valid-user

```

kommt die BasicAuth Abfrage bei Api call nicht und ich bekomme ein&nbsp;

> {„errors“:[{„code“:„9“,„status“:„401“,„title“:„The resource owner or authorization server denied the request.“,„detail“:„Missing \u0022Authorization\u0022 header“}]}

---

<div class="post-metadata">

**Author:** ![benblub](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@benblub](https://forum.shopware.com/u/benblub)\
**Post date:** [9. Dezember 2019 um 12:05 UTC](https://forum.shopware.com/t/solved-nach-installation-login-probleme-access-probleme-api-auch-mit-basicauth/63404/2 "2019-12-09T12:05:33Z")

</div>

&nbsp;

File:&nbsp;vendor/nyholm/psr7/src/MessageTrait.php Line: 194

auskommentieren dieser Zeile hat das Problem beim einloggen erstmal gelöst. (Mit htpasswd wie auch only mit orginal htaccess File)

```
//throw new \InvalidArgumentException('Header values must be RFC 7230 compatible strings.');

```

Ist das ein Bug seitens Shopware? Auf der anderen Seite hatte ich lokal install mit vagrant keine Probleme.

---

<div class="post-metadata">

**Author:** ![benblub](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@benblub](https://forum.shopware.com/u/benblub)\
**Post date:** [10. Dezember 2019 um 14:28 UTC](https://forum.shopware.com/t/solved-nach-installation-login-probleme-access-probleme-api-auch-mit-basicauth/63404/3 "2019-12-10T14:28:45Z")

</div>

Problem behoben.&nbsp;

Digest-Auth Aufrufe wurden vom Server als BasicAuth behandelt was wiederum zu nicht UTF8 tauglichen Headern geführt…
