Package io.jmix.saml.mapper.role
Class DefaultSamlAssertionRolesMapper
java.lang.Object
io.jmix.saml.mapper.role.BaseSamlAssertionRolesMapper
io.jmix.saml.mapper.role.DefaultSamlAssertionRolesMapper
- All Implemented Interfaces:
SamlAssertionRolesMapper
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 Summary
FieldsFields inherited from class io.jmix.saml.mapper.role.BaseSamlAssertionRolesMapper
resourceRoleRepository, roleGrantedAuthorityUtils, rowLevelRoleRepository -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<String> getResourceRolesCodes(org.opensaml.saml.saml2.core.Assertion assertion) protected Collection<String> getRolesCodes(org.opensaml.saml.saml2.core.Assertion assertion, String roleNamePrefix) protected Collection<String> getRowLevelRoleCodes(org.opensaml.saml.saml2.core.Assertion assertion) voidsetResourceRolePrefix(String resourceRolePrefix) voidsetRolesAttributeName(String rolesAttributeName) voidsetRowLevelRolePrefix(String rowLevelRolePrefix) Methods inherited from class io.jmix.saml.mapper.role.BaseSamlAssertionRolesMapper
toGrantedAuthorities, toResourceRoles, toRowLevelRoles
-
Field Details
-
rolesAttributeName
-
resourceRolePrefix
-
rowLevelRolePrefix
-
-
Constructor Details
-
DefaultSamlAssertionRolesMapper
public DefaultSamlAssertionRolesMapper()
-
-
Method Details
-
getResourceRolesCodes
protected Collection<String> getResourceRolesCodes(org.opensaml.saml.saml2.core.Assertion assertion) - Specified by:
getResourceRolesCodesin classBaseSamlAssertionRolesMapper
-
getRowLevelRoleCodes
- Specified by:
getRowLevelRoleCodesin classBaseSamlAssertionRolesMapper
-
getRolesCodes
protected Collection<String> getRolesCodes(org.opensaml.saml.saml2.core.Assertion assertion, String roleNamePrefix) -
getRolesAttributeName
-
setRolesAttributeName
-
getResourceRolePrefix
-
setResourceRolePrefix
-
getRowLevelRolePrefix
-
setRowLevelRolePrefix
-