When using basic authentication, are there any limits on the length of:
- the username,
- the password,
- the combined username and password
Are there any practical limits imposed by commonly used clients or client frameworks?
When using basic authentication, are there any limits on the length of:
Are there any practical limits imposed by commonly used clients or client frameworks?
HTTP
basic authentication is specified in section 2 of RFC2617; which does not specify any explicit limit on the maximum size of either the challenge or the response.
So the answer is that there is no official maximum limit.
I don't know of any specific limits in various client or server-side HTTP
implementations. If I was in your position, then I would approach this question like this:
1) On the server side, external factors will dictate the maximum userid and password size. You're going to authentication the userid and the password from somewhere. It's going to come from either a password file of some sorts, or some directory service or database, and that's going to dictate your maximum limits.
2) On the client side, I will reasonably assume that my prompts to the client for the login ID and the password will have a maximum limit of 255 characters, each; until someone complains to me.