Is there a maximum length for a HTTP BASIC authent

2019-02-12 04:15发布

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.)

2条回答
Lonely孤独者°
2楼-- · 2019-02-12 05:14

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.

查看更多
疯言疯语
3楼-- · 2019-02-12 05:17

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.

查看更多
登录 后发表回答