Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-5309

OAuth: prevent twice the redirect

    XMLWordPrintable

    Details

      Description

      Dependent of the configuration and if the user is already logged in OpenOlat, clicking on a link like this:

      https://localhost:443/dmz/1%3A1%3Aomain_loging%3A1%3A0%3Acid%3Alogin%3Alp%3AOAuth/?provider=AZUREAD
      

      can produce a red screen because it try to redirect twice the user to the right login screen.

      **RedScreen** could not create controller via reflection. classname:org.olat.login.oauth.ui.OAuthAuthenticationController
      
      <dispatchinfo>
      	<componentinfo>
      		<compname>vc_login</compname>
      		<compclass>org.olat.core.gui.components.velocity.VelocityContainer</compclass>
      		<extendedinfo>page:org/olat/login/_content/login.html </extendedinfo>
      		<event>
      			<class&gt;org.olat.core.gui.control.Event</class&gt;
      			<command>login</command>
      			<tostring>com:login,org.olat.core.gui.control.Event@625ef88</tostring>
      		</event>
      	</componentinfo>
      	<controllerinfo>
      		<controllername>org.olat.login.LoginAuthprovidersController</controllername>
      		<controllername>org.olat.core.commons.fullWebApp.BaseFullWebappController</controllername>
      	</controllerinfo>
      </dispatchinfo>
      
      org.olat.core.logging.AssertException: could not create controller via reflection. classname:org.olat.login.oauth.ui.OAuthAuthenticationController
       at org.olat.core.gui.control.creator.AutoCreator.createController(AutoCreator.java:92)
       at org.olat.login.auth.AuthenticationProvider.createController(AuthenticationProvider.java:133)
       at org.olat.login.LoginAuthprovidersController.initLoginContent(LoginAuthprovidersController.java:167)
       at org.olat.login.LoginAuthprovidersController.event(LoginAuthprovidersController.java:258)
       at org.olat.core.gui.control.DefaultController.dispatchEvent(DefaultController.java:214)
       at org.olat.core.gui.components.AbstractComponent$1.run(AbstractComponent.java:240)
       at org.olat.core.logging.activity.ThreadLocalUserActivityLoggerInstaller.runWithUserActivityLogger(ThreadLocalUserActivityLoggerInstaller.java:108)
       at org.olat.core.gui.components.AbstractComponent.fireEvent(AbstractComponent.java:238)
       at org.olat.core.gui.components.velocity.VelocityContainer.doDispatchRequest(VelocityContainer.java:114)
       at org.olat.core.gui.components.AbstractComponent.dispatchRequest(AbstractComponent.java:193)
       at org.olat.core.gui.components.Window.doDispatchToComponent(Window.java:1255)
       at org.olat.core.gui.components.Window.dispatchRequest(Window.java:723)
       at org.olat.core.gui.components.Window.doDispatchRequest(Window.java:313)
       at org.olat.core.gui.components.AbstractComponent.dispatchRequest(AbstractComponent.java:193)
       at org.olat.dispatcher.DMZDispatcher.execute(DMZDispatcher.java:273)
       at org.olat.core.servlets.OpenOLATServlet.executeUserRequest(OpenOLATServlet.java:297)
       at org.olat.core.servlets.OpenOLATServlet.doGet(OpenOLATServlet.java:208)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:626)
       at org.olat.core.servlets.OpenOLATServlet.service(OpenOLATServlet.java:159)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
       at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
       at org.olat.core.servlets.HeadersFilter.doFilter(HeadersFilter.java:64)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
       at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:431)
       at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
       at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
       at org.apache.tomcat.util.net.Nio2Endpoint$SocketProcessor.doRun(Nio2Endpoint.java:1674)
       at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
       at org.apache.tomcat.util.net.AbstractEndpoint.processSocket(AbstractEndpoint.java:1104)
       at org.apache.tomcat.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:598)
       at org.apache.tomcat.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:576)
       at java.base/sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:127)
       at java.base/sun.nio.ch.Invoker$2.run(Invoker.java:219)
       at java.base/sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
       at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
       at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: java.lang.reflect.InvocationTargetException
       at jdk.internal.reflect.GeneratedConstructorAccessor2325.newInstance(Unknown Source)
       at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
       at org.olat.core.gui.control.creator.AutoCreator.createController(AutoCreator.java:72)
      ... 49 more Caused by: org.olat.core.logging.AssertException: can only call this method once per click = can only dispatch one image or such at a time
       at org.olat.core.gui.control.DispatchResult.setResultingMediaResource(DispatchResult.java:53)
       at org.olat.login.oauth.ui.OAuthAuthenticationController.redirect(OAuthAuthenticationController.java:120)
       at org.olat.login.oauth.ui.OAuthAuthenticationController.<init>(OAuthAuthenticationController.java:65)
      ... 53 more Caused by: java.lang.Exception: assertionstackgenerator
       at org.olat.core.logging.AssertException.<init>(AssertException.java:53)
      ... 56 more
      
      

        Attachments

          Activity

            People

            srosse Stéphane Rossé
            gnaegi Florian Gnägi
            Florian Gnägi Florian Gnägi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: