Is there a maximum length for a HTTP BASIC authent

2019-02-12 04:24发布

问题:

Is there a maximum length for a username or password which is sent to a web application through HTTP BASIC authentication? I looked through RFC2617 and couldn't find anything obvious, but was curious and wanted to make sure.

(This is all being done over SSL, so don't worry about security for my sake.)

回答1:

There's no spec-enforced limit on the auth token. However you may run into practical server-specific limits on HTTP headers in general, as outlined in this question.



回答2:

According to http://httpd.apache.org/docs/2.4/programs/htpasswd.html#restrictions there is a limit of 255 characters for the username (and the username may not contain : ).

On Windows there is additionally a limit of 255 characters for the password - if the password is longer it will be truncated.