Uploaded image for project: 'WildFly Elytron'
  1. WildFly Elytron
  2. ELY-2361

Realm mapper Evidence always null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 2.0.0.Beta1, 1.18.3.Final, 1.15.13.Final
    • Realms
    • None
    • Hide

      Create custom realm mapper class

      public class CRM implements RealmMapper {
          @Override
          public String getRealmMapping(Principal principal, Evidence evidence) {
              // evidence is always null in here
              return null;
          }
      } 

      Register inside standalone

      <subsystem xmlns="urn:wildfly:elytron:13.0" final-providers="combined-providers" disallowed-providers="OracleUcrypto">
      <security-domains>
      <security-domain name="Custom-Domain" default-realm="Custom-Realm" permission-mapper="default-permission-mapper" realm-mapper="CustomRealmMapper" role-decoder="roles-attribute">
                          <realm name="Custom-Realm"/>
                      </security-domain>
      </security-domains>
      <security-realms>
      <custom-realm name="Custom-Realm" module="local.login" class-name="local.login.CustomRealm">
                          <configuration>
                              <property name="dataSourceJndiName" value="java:/CDataSource"/>
                          </configuration>
                      </custom-realm>
      </security-realms>
      <mappers>
      <customer-realm-mapper name="CustomRealmMapper" module="local.login" class-name="local.login.CRM"/>
      </mappers>
      </subsystem> 
      Show
      Create custom realm mapper class public class CRM implements RealmMapper { @Override public String getRealmMapping(Principal principal, Evidence evidence) { // evidence is always null in here return null ; } } Register inside standalone <subsystem xmlns= "urn:wildfly:elytron:13.0" final -providers= "combined-providers" disallowed-providers= "OracleUcrypto" > <security-domains> <security-domain name= "Custom-Domain" default -realm= "Custom-Realm" permission-mapper= " default -permission-mapper" realm-mapper= "CustomRealmMapper" role-decoder= "roles-attribute" >                     <realm name= "Custom-Realm" />                 </security-domain> </security-domains> <security-realms> <custom-realm name= "Custom-Realm" module= "local.login" class- name= "local.login.CustomRealm" >                     <configuration>                         <property name= "dataSourceJndiName" value= "java:/CDataSource" />                     </configuration>                 </custom-realm> </security-realms> <mappers> <customer-realm-mapper name= "CustomRealmMapper" module= "local.login" class- name= "local.login.CRM" /> </mappers> </subsystem>

      When using custom realm mapper function getRealmMapping always returns Evidence as null.

      Jboss version 7.4

      Wildfly versions tried: 1.15... 2.0...

        1. standalone.xml
          30 kB
        2. simple-webapp.zip
          22 kB
        3. server.log
          27 kB
        4. custom-realm.zip
          15 kB

              rhn-support-ivassile Ilia Vassilev
              martynasselvenisworldline Martynas Selvenis (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: