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

oAuth dispatcher does not accept usernames that don't validate as emails

    XMLWordPrintable

    Details

      Description

      How to reproduce

      • Using REST API create username like "dings.bums bla@test.com" (note the space in the username).
      • Log in usine oAuth provider using this username
        => can not log in

      The problem is that the code first tries to lookup the user by email and the email-like username does not validate against the email pattern.

      stack of 1.cause::org.olat.core.logging.AssertException: Identity cannot be searched by email, if email is not valid. Used address: dings.bums bla@test.com -> at org.olat.user.UserManagerImpl.findIdentityByEmail(UserManagerImpl.java:190) at org.olat.login.oauth.OAuthDispatcher.login(OAuthDispatcher.java:205) at org.olat.login.oauth.OAuthDispatcher.execute(OAuthDispatcher.java:150) at org.olat.core.servlets.OpenOLATServlet.executeUserRequest(OpenOLATServlet.java:289) at org.olat.core.servlets.OpenOLATServlet.doGet(OpenOLATServlet.java:218) at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) at org.olat.core.servlets.OpenOLATServlet.service(OpenOLATServlet.java:175) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)>>>stack of 2.cause::java.lang.Exception: assertionstackgenerator -> at org.olat.core.logging.AssertException.(AssertException.java:53) at org.olat.user.UserManagerImpl.findIdentityByEmail(UserManagerImpl.java:190) at org.olat.login.oauth.OAuthDispatcher.login(OAuthDispatcher.java:205) at org.olat.login.oauth.OAuthDispatcher.execute(OAuthDispatcher.java:150) at org.olat.core.servlets.OpenOLATServlet.executeUserRequest(OpenOLATServlet.java:289) at org.olat.core.servlets.OpenOLATServlet.doGet(OpenOLATServlet.java:218) at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) at org.olat.core.servlets.OpenOLATServlet.service(OpenOLATServlet.java:175) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: