ARTIFACTORY: “Groups length is higher than the limit” error with SAML login

AuthorFullName__c
Venu Reddy
articleNumber
000005273
FirstPublishedDate
2022-05-18T06:14:37Z
lastModifiedDate
2025-05-15

ARTIFACTORY: “Groups length is higher than the limit” error with SAML login

Description

When a SAML user tries to login to Artifactory, the attempt fails and the console.log will have entries such as below


2022-04-25T23:01:36.427Z ^[[1;32m[jfrt ]^[[0;39m ^[[39m[DEBUG]^[[0;39m [1bcf15005756f4ae] [o.a.a.s.s.SamlHandlerImpl:177 ] [ttp-nio-8081-exec-44] - resolved number of SAML groups: '0'
2022-04-25T23:01:36.427Z ^[[1;32m[jfrt ]^[[0;39m ^[[39m[DEBUG]^[[0;39m [1bcf15005756f4ae] [o.a.a.s.s.SamlHandlerImpl:183 ] [ttp-nio-8081-exec-44] - resolved SAML email: '<email_address>'
2022-04-25T23:01:36.427Z ^[[1;32m[jfrt ]^[[0;39m ^[[39m[DEBUG]^[[0;39m [1bcf15005756f4ae] [o.a.a.s.s.SamlHandlerImpl:187 ] [ttp-nio-8081-exec-44] - resolved SAML user: '<username>'
2022-04-25T23:01:36.579Z ^[[1;32m[jfrt ]^[[0;39m ^[[31m[WARN ]^[[0;39m [1bcf15005756f4ae] [.o.SingleSignOnServiceImpl:118] [ttp-nio-8081-exec-44] - Couldn't verify token. Reason parse
2022-04-25T23:01:38.870Z ^[[37m[jffe ]^[[39m ^[[31m[WARN ]^[[39m [1bcf15005756f4ae] [                              ] [main                ] - AccessTokenService::getGroups groups length is  higher than the limit - 1800.
Trying to compress groups
2022-04-25T16:01:39.902L ^[[35m[tomct]^[[0m [INFO ] [                ] [org.apache.coyote.http11.Http11Processor] [org.apache.coyote.http11.Http11Processor service] - Error parsing HTTP request header

Note

Further occurrences of HTTP request parsing errors will be logged at DEBUG level.

 
Resolution
The above indicates that the header that is being received by Artifactory from the SAML provider contains more than 1800 characters which should prevent the user from logging in to the system.
The fix involves editing the $JFROG_HOME/artifactory/app/misc/tomcat/server.xml file. Add the following value to both Artifactory and Access connectors: maxHttpHeaderSize=”16384” The default value for this parameter in Tomcat 8.x is 8192.
For your reference, this is how the modified file would look like
<Server port="8015" shutdown="SHUTDOWN">
   <Service name="Catalina">
    <Connector port="8081" maxHttpHeaderSize="16384" sendReasonPhrase="true" relaxedPathChars='[]' relaxedQueryChars='[]' maxThreads="200"/>
    <Connector port="8091" address="localhost" maxThreads="5" acceptCount="5"/>
    <!-- Must be at least the value of artifactory.access.client.max.connections -->
    <Connector port="8040" maxHttpHeaderSize="16384" sendReasonPhrase="true" maxThreads="50"/>
    <Engine name="Catalina" defaultHost="localhost">
        <Host name="localhost" workDir="${JF_PRODUCT_HOME}/var/work/artifactory/tomcat" appBase="webapps" startStopThreads="2"/>
    </Engine>
</Service>
</Server>

Note

Artifactory service needs to be restarted for the change to be effective.