Yes. If the HTTP 400 occurs because the Kerberos ticket is too large, increasing MaxTokenSize is part of the fix.
This happens when a user belongs to many groups. Kerberos builds an authorization token that contains the user SID, group SIDs, and possibly sIDHistory and claims data. If that token is too large, authentication can fail, and web apps that use HTTP/IIS may return HTTP 400 Bad Request or Request Header Too Long.
Recommended value:
- For Windows Server 2012 and later, the default
MaxTokenSizeis 48,000 bytes. - 48,000 bytes is also the recommended value for most implementations.
- Although the maximum allowed value is 65,535 bytes, setting
MaxTokenSizeabove 48,000 is not recommended for HTTP/IIS scenarios because Kerberos tickets sent in HTTP are base64-encoded and expand to about 133% of their original size.
Important limits and guidance:
- Set
MaxTokenSizeon each computer that participates in the Kerberos authentication process, including client devices. In multi-tier scenarios, that can also include web servers and back-end servers involved in delegated authentication. - The registry path is:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters - The value type is
REG_DWORD. - A restart is required after changing it.
- If
MaxTokenSizeis increased beyond 48,000, IIS may still fail because IIS/HTTP request buffer limits can be hit.
For IIS-based HTTP 400 errors, MaxTokenSize alone may not be enough. The IIS server may also need larger HTTP header limits:
-
MaxFieldLength -
MaxRequestBytes
For Windows Server 2016 and later IIS systems, those are under:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters
The documented sizing for those IIS-related values is:
-
MaxFieldLength=(4/3 * T bytes) + 200 -
MaxRequestBytes=(4/3 * T bytes) + 200
Where T is the Kerberos token size in bytes.
Risk warning: changing these registry values is potentially dangerous. Larger HTTP limits can increase memory usage in Http.sys and increase exposure to malicious traffic. Use the minimum value that resolves the issue.
Practical recommendation:
- If the affected systems are older than Windows Server 2012 / Windows 8-era defaults, set
MaxTokenSizeto 48,000 first. - Do not raise it above 48,000 unless there is a clearly calculated requirement and the known IIS and protocol limitations have been reviewed.
- If the error is specifically HTTP 400 / Request Header Too Long in IIS-backed apps, review and size
MaxFieldLengthandMaxRequestByteson the IIS server as well.
- Problems with Kerberos authentication when a user belongs to many groups
- Problems with Kerberos authentication when a user belongs to many groups
- Problems with Kerberos authentication when a user belongs to many groups
- How to use Group Policy to add the MaxTokenSize registry entry to multiple computers
- HTTP 400 Bad Request (Request Header too long) responses to HTTP requests
- HTTP 400 Bad Request (Request Header too long) responses to HTTP requests