Class DefaultSamlAssertionRolesMapper

java.lang.Object
io.jmix.saml.mapper.role.BaseSamlAssertionRolesMapper
io.jmix.saml.mapper.role.DefaultSamlAssertionRolesMapper
All Implemented Interfaces:
SamlAssertionRolesMapper

@NullMarked public class DefaultSamlAssertionRolesMapper extends BaseSamlAssertionRolesMapper
Default implementation of SamlAssertionRolesMapper that takes role names from SAML assertion attribute and transforms them to resource and row-level roles using role name prefixes.

Roles names are taken from a special assertion attribute. Attribute name is taken from the rolesAttributeName property. The default value is taken from the SamlProperties.DefaultSamlAssertionRolesMapperConfig.getRolesAssertionAttribute()

Role names from the assertion attribute are mapped to the resource and row-level roles using resourceRolePrefix and rowLevelRolePrefix prefixes, e.g., if the resourceRolePrefix is "resource$" then SAML role with the name "resource$system-full-access" will be mapped to Jmix role with the "system-full-access" code. By default the prefixes are empty.

  • Field Details

    • rolesAttributeName

      protected String rolesAttributeName
    • resourceRolePrefix

      protected String resourceRolePrefix
    • rowLevelRolePrefix

      protected String rowLevelRolePrefix
  • Constructor Details

    • DefaultSamlAssertionRolesMapper

      public DefaultSamlAssertionRolesMapper()
  • Method Details

    • getResourceRolesCodes

      protected Collection<String> getResourceRolesCodes(org.opensaml.saml.saml2.core.Assertion assertion)
      Specified by:
      getResourceRolesCodes in class BaseSamlAssertionRolesMapper
    • getRowLevelRoleCodes

      protected Collection<String> getRowLevelRoleCodes(org.opensaml.saml.saml2.core.Assertion assertion)
      Specified by:
      getRowLevelRoleCodes in class BaseSamlAssertionRolesMapper
    • getRolesCodes

      protected Collection<String> getRolesCodes(org.opensaml.saml.saml2.core.Assertion assertion, String roleNamePrefix)
    • getRolesAttributeName

      public String getRolesAttributeName()
    • setRolesAttributeName

      public void setRolesAttributeName(String rolesAttributeName)
    • getResourceRolePrefix

      public String getResourceRolePrefix()
    • setResourceRolePrefix

      public void setResourceRolePrefix(String resourceRolePrefix)
    • getRowLevelRolePrefix

      public String getRowLevelRolePrefix()
    • setRowLevelRolePrefix

      public void setRowLevelRolePrefix(String rowLevelRolePrefix)