Jump to content
We've recently updated our Privacy Statement, available here ×
  • 'Invalid character found in the request target' with Token based authentication


    stasp
    • Features: JasperReports Server Version: v8.0.0 Product: JasperReports® Server

    Issue description

    With Token authentication configured for JasperReports Server you may sometimes run into an error like this when trying to authenticate:

    19-Jan-2017 16:49:36.418 INFO [http-nio-8443-exec-12] org.apache.coyote.http11.AbstractHttp11Processor.process Error parsing HTTP request header 

    Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level. 

    java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986 

    at org.apache.coyote.http11.AbstractNioInputBuffer.parseRequestLine(AbstractNioInputBuffer.java:283) 

    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1013) 

    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670) 

    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520) 

    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476) 

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 

    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) 

    at java.lang.Thread.run(Thread.java:745)

    Explanation and solution

    There can be different reasons why the token cannot be parced, but often times it's just incorrect URL format. For example, Tomcat 8.0.39 and some other versions cannot handle requests with certain symbols in request parameters, for example the pipe symbol '|'. This issue is discussed in more details in the following thread on stackoverflow.com:

    http://stackoverflow.com/questions/41053653/tomcat-8-is-not-able-to-handle-get-request-with-in-query-parameters

    To get rid of the error you can change the default separator to a different symbol (for example '+') in the applicationContext-externalAuth-preAuth-mt.xml file in the following section:

    <bean class="com.jaspersoft.jasperserver.multipleTenancy.security.externalAuth.preauth.MTJSPreAuthenticatedUserDetailsService">
           <!-- Token format configuration example for token: u=obama|r=PRESIDENT,HUSBAND|o=WhiteHouse|pa1=USA,Kenya|pa2=Washington -->
           <property name="tokenPairSeparator" value="|"/>
     ...
     </bean>
     
    Then save the file and restart the server
     
     
    ------------------------
    Ref. case #01447230

    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...