2 Replies Latest reply on Feb 7, 2018 12:43 PM by pcarrollnf

    Elytron Security Port 80 j_security_check

    pcarrollnf

      Hello, I am developing an application using Wildfly 11.0 and Elytron as the security subsystem.

       

      I am using FORM based authentication.  I am seeing an issue where the user receives a "This page can’t be displayed" after authentication occurs.  It appears that the user is authenticated successfully.  However, for some reason the HTTP becomes -1.

       

      Here is a portion of the log after the user authenticates.

       

      TRACE [org.wildfly.security] (default task-32) Authorizing username: [myUser], Request URI: [http://myAppServer/j_security_check], Context path: [/]
      TRACE [org.wildfly.security] (default task-32) Role mapping: principal [myUser] -> decoded roles [MY_ROLE] -> realm mapped roles [MY_ROLE] -> domain mapped roles [MY_ROLE]
      TRACE [org.wildfly.security] (default task-32) Authorizing principal myUser.
      TRACE [org.wildfly.security] (default task-32) Authorizing against the following attributes: [roles] => [MY_ROLE]
      TRACE [org.wildfly.security] (default task-32) Permission mapping: identity [myUser] with roles [MY_ROLE] implies ("org.wildfly.security.auth.permission.LoginPermission" "") = true
      TRACE [org.wildfly.security] (default task-32) Authorization succeed
      TRACE [org.wildfly.security] (default task-32) Handling CachedIdentityAuthorizeCallback: principal = myUser  authorizedIdentity = SecurityIdentity{principal=myUser, securityDomain=org.wildfly.security.auth.server.SecurityDomain@1abbd025, authorizationIdentity=EMPTY, realmInfo=RealmInfo{name='MyRealm', securityRealm=org.wildfly.security.auth.realm.jdbc.JdbcSecurityRealm@2ad18868}, creationTime=}
      DEBUG [org.wildfly.security] (default task-32) User [myUser] authenticated successfully using FormAuthenticationMechanism
      TRACE [org.wildfly.security] (default task-32) Handling AuthenticationCompleteCallback: succeed
      TRACE [org.wildfly.security] (default task-32) Handling SecurityIdentityCallback: identity = SecurityIdentity{principal=myUser, securityDomain=org.wildfly.security.auth.server.SecurityDomain@1abbd025, authorizationIdentity=EMPTY, realmInfo=RealmInfo{name='MyRealm', securityRealm=org.wildfly.security.auth.realm.jdbc.JdbcSecurityRealm@2ad18868}, creationTime=}
      TRACE [org.wildfly.security] (default task-32) User redirected to original path [http://myAppServer:-1/myAppPage]
      
      

      As you can see on the last line of the log, the the HTTP port is -1.  I have the port set to 80 in the undertow subsystem.

      <socket-binding name="http" port="${jboss.http.port:80}"/>

       

      When I change the port to 8080 in the undertow subsystem, the user is redirected correctly after form authentication.

      DEBUG [org.wildfly.security] (default task-7) User [myUser] authenticated successfully using FormAuthenticationMechanism
      TRACE [org.wildfly.security] (default task-7) Handling AuthenticationCompleteCallback: succeed
      TRACE [org.wildfly.security] (default task-7) Handling SecurityIdentityCallback: identity = SecurityIdentity{principal=myUser, securityDomain=org.wildfly.security.auth.server.SecurityDomain@3cbee0d, authorizationIdentity=EMPTY, realmInfo=RealmInfo{name='MyRealm', securityRealm=org.wildfly.security.auth.realm.jdbc.JdbcSecurityRealm@57dad2d1}, creationTime=}
      TRACE [org.wildfly.security] (default task-7) User redirected to original path [http://myAppServer:8080/myAppPage]
      

       

      Is there something else that needs to be configured when using port 80 for HTTP in order to get this working correctly?