Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-5086

Illegal State Exception REST with invalid credentials and Accept header

    Details

      Description

      When the credentials are valid, with the curl invocation below, the endpoint is returning the expected information. But exception raised when wrong password. The curl command receives an empty response body on 4.0. While on 3.1, the whole exception stack is returned in an HTML document.

      curl 'http://localhost:8080/openidm/info/login' -H 'X-OpenIDM-Username: openidm-admin' -H 'X-OpenIDM-Password: wrong-password' -H 'Accept: *; q=.7'
      
      org.ops4j.pax.web.service.spi.model.ServletModel-5: RuntimeException caught
      java.lang.IllegalArgumentException: Could not parse '*; q=.7'
      	at org.forgerock.guava.common.net.MediaType.parse(MediaType.java:629)
      	at org.forgerock.caf.authentication.framework.ResponseHandler.getResponseHandler(ResponseHandler.java:107)
      	at org.forgerock.caf.authentication.framework.ResponseHandler.handle(ResponseHandler.java:95)
      	at org.forgerock.caf.authentication.framework.AuthenticationFramework$6.apply(AuthenticationFramework.java:253)
      	at org.forgerock.caf.authentication.framework.AuthenticationFramework$6.apply(AuthenticationFramework.java:250)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:223)
      	at org.forgerock.caf.authentication.framework.AuthenticationFramework.validateRequest(AuthenticationFramework.java:168)
      	at org.forgerock.caf.authentication.framework.AuthenticationFramework.access$100(AuthenticationFramework.java:65)
      	at org.forgerock.caf.authentication.framework.AuthenticationFramework$1.apply(AuthenticationFramework.java:155)
      	at org.forgerock.caf.authentication.framework.AuthenticationFramework$1.apply(AuthenticationFramework.java:152)
      	at org.forgerock.util.promise.PromiseImpl$7.handleStateChange(PromiseImpl.java:445)
      	at org.forgerock.util.promise.PromiseImpl.handleCompletion(PromiseImpl.java:521)
      	at org.forgerock.util.promise.PromiseImpl.addOrFireListener(PromiseImpl.java:509)
      	at org.forgerock.util.promise.PromiseImpl.thenAsync(PromiseImpl.java:438)
      	at org.forgerock.caf.authentication.framework.AuthenticationFramework.processMessage(AuthenticationFramework.java:146)
      	at org.forgerock.caf.authentication.framework.AuthenticationFilter.filter(AuthenticationFilter.java:96)
      	at org.forgerock.openidm.auth.AuthFilterWrapper.filter(AuthFilterWrapper.java:90)
      	at org.forgerock.http.handler.Chain.handle(Chain.java:55)
      	at org.forgerock.http.handler.Chain.handle(Chain.java:57)
      	at org.forgerock.http.filter.TransactionIdInboundFilter.filter(TransactionIdInboundFilter.java:60)
      	at org.forgerock.http.handler.Chain.handle(Chain.java:55)
      	at org.forgerock.http.servlet.HttpFrameworkServlet.service(HttpFrameworkServlet.java:222)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
      	at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:83)
      	at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:364)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.forgerock.openidm.servletregistration.impl.ServletRegistrationSingleton$FilterProxy.invoke(ServletRegistrationSingleton.java:295)
      	at com.sun.proxy.$Proxy18.doFilter(Unknown Source)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:259)
      	at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:222)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.forgerock.openidm.servletregistration.impl.ServletRegistrationSingleton$FilterProxy.invoke(ServletRegistrationSingleton.java:295)
      	at com.sun.proxy.$Proxy18.doFilter(Unknown Source)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
      	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:70)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
      	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:267)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      	at org.eclipse.jetty.server.Server.handle(Server.java:497)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
      	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.IllegalStateException
      	at org.forgerock.guava.common.base.Preconditions.checkState(Preconditions.java:158)
      	at org.forgerock.guava.common.net.MediaType$Tokenizer.consumeCharacter(MediaType.java:665)
      	at org.forgerock.guava.common.net.MediaType.parse(MediaType.java:600)
      	... 62 more
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alin Alin Brici
                Reporter:
                patrickdiligent patrick diligent
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: