Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-12518

ConnectionSecurityContext.getConnectionPrincipals leads to IllegalStateException getConnectionPrincipals

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 18.0.0.Beta1
    • Fix Version/s: 18.0.0.Final
    • Component/s: Security
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      Our application use an ejb-interceptor to switch the user context of an remote invocation. The interceptor uses ConnectionSecurityContext.getConnectionPrincipals() to check the current connected user. But some server instances are configured without an SecurityRealm, to allow anonymous access. At this instances a IllegalStateException "realm is null' stops the remote call.

      Breakpoint hit: "thread=default task-12", org.jboss.as.security.api.ConnectionSecurityContext.getConnectionPrincipals(), line=75 bci=54

      default task-12[1] locals
      Method arguments:
      Local variables:
      con = instance of org.jboss.as.security.remoting.RemotingContext$RemotingRemoteConnection(id=39556)
      principals = instance of java.util.HashSet(id=39557)
      localIdentity = instance of org.wildfly.security.auth.server.SecurityIdentity(id=39558)
      principal = instance of org.wildfly.security.auth.principal.AnonymousPrincipal(id=39559)
      realm = null

      Show
      Our application use an ejb-interceptor to switch the user context of an remote invocation. The interceptor uses ConnectionSecurityContext.getConnectionPrincipals() to check the current connected user. But some server instances are configured without an SecurityRealm, to allow anonymous access. At this instances a IllegalStateException "realm is null' stops the remote call. Breakpoint hit: "thread=default task-12", org.jboss.as.security.api.ConnectionSecurityContext.getConnectionPrincipals(), line=75 bci=54 default task-12 [1] locals Method arguments: Local variables: con = instance of org.jboss.as.security.remoting.RemotingContext$RemotingRemoteConnection(id=39556) principals = instance of java.util.HashSet(id=39557) localIdentity = instance of org.wildfly.security.auth.server.SecurityIdentity(id=39558) principal = instance of org.wildfly.security.auth.principal.AnonymousPrincipal(id=39559) realm = null

      Description

      The commit https://github.com/wildfly/wildfly/commit/121c02b004adaca76e306bf3e8c16b3056bd0db1#diff-554f8ec76c02b6cbacc688356f164fe8 leads direct to an IllegalStateException during anonymous login.
      In this case is no Realm available and the constructor of new RealmUser(realm, principal.getName()) throws an IllegalStateException.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  dastraub Daniel Straub
                  Reporter:
                  dastraub Daniel Straub
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: