Clemens Gruber: Verzeichnisschutz .htaccess ohne Pop-Up / apache_lookup_uri()

Beitrag lesen

Hallo Clemens,

In welcher Reihenfolge läuft bei http://login:passwort@www.domain.de/geschuetzt/ die Authentifizierung und Überprüfung der Daten ab?

Du weißt, dass ein URL in dieser Form nicht gültig ist?
Nachzulesen im RFC 1738, Abschnitt 3.3: http://rfc.net/rfc1738.html

Hi Stefan!

Danke, für den Hinweis auf RFC 1738! Da steht dann auch:

3.1. Common Internet Scheme Syntax

While the syntax for the rest of the URL may vary depending on the
   particular scheme selected, URL schemes that involve the direct use
   of an IP-based protocol to a specified host on the Internet use a
   common syntax for the scheme-specific data:

//<user>:<password>@<host>:<port>/<url-path>

Some or all of the parts "<user>:<password>@", ":<password>",
   ":<port>", and "/<url-path>" may be excluded.  The scheme specific
   data start with a double slash "//" to indicate that it complies with
   the common Internet scheme syntax. The different components obey the
   following rules:

user
        An optional user name. Some schemes (e.g., ftp) allow the
        specification of a user name.

password
        An optional password. If present, it follows the user
        name separated from it by a colon.

The user name (and password), if present, are followed by a
   commercial at-sign "@". Within the user and password field, any ":",
   "@", or "/" must be encoded.

Und da hammer's dann:
must be encoded.
        -------

Da es auch in der Form http://login:passwort@www.domain.de/geschuetzt/ mit JavaScipt und bei direkter Eingabe geht bin ich fälschlicherweise davon ausgegangen, dass Apache und PHP das auch so schmeckt ;-)

Meintest Du das fehlende encoding als ungültig oder den generelle Aufbau. Du hast auf Abschnitt 3.3 HTTP URL scheme verwiesen. Als Strato die sog. @-Domains einführte gabe es da eine Diskussion ob das nun RFC-konform sei oder nicht. Allerdings würde von Strato die Sache vor dem @ als Variable per JavaScript ausgelesen und dann zu entsprechenden Dateien weitergeleitet. Das hatte also nichts mehr mit Username und Passwort zu tun. Es kann natürlich sein, dass mit HTTP der Common Internet Scheme Syntax aus Abschnitt 3.1  seine Gültigkeit verliert und nur noch der in Abschnitt 3.3 spezifizierte Syntax gültigkeit hat.