Is there a maximum length for a HTTP BASIC authentication username?
Is there a maximum length for a username or password which is sent to a web application through HTTP BASIC authentication? I looked thro开发者_JAVA百科ugh 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.)
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.
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.
精彩评论