Class ShibbolethCompatiblePersistentIdGenerator
- java.lang.Object
-
- org.apereo.cas.authentication.principal.ShibbolethCompatiblePersistentIdGenerator
-
- All Implemented Interfaces:
java.io.Serializable
,org.apereo.cas.authentication.principal.PersistentIdGenerator
public class ShibbolethCompatiblePersistentIdGenerator extends java.lang.Object implements org.apereo.cas.authentication.principal.PersistentIdGenerator
Generates PersistentIds based on the Shibboleth algorithm. The generated ids are based on a principal attribute is specified, or the authenticated principal id.- Since:
- 3.1
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ShibbolethCompatiblePersistentIdGenerator(java.lang.String salt)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
determinePrincipalIdFromAttributes(java.lang.String defaultId, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> attributes)
Determine principal id from attributes.protected java.lang.String
digestAndEncodeWithSalt(java.security.MessageDigest md)
Digest and encode with salt string.java.lang.String
generate(java.lang.String principal, java.lang.String service)
java.lang.String
generate(org.apereo.cas.authentication.principal.Principal principal, java.lang.String service)
protected static java.security.MessageDigest
prepareMessageDigest(java.lang.String principal, java.lang.String service)
Prepare message digest message digest.java.lang.String
toString()
-
-
-
Method Detail
-
generate
public java.lang.String generate(java.lang.String principal, java.lang.String service)
- Specified by:
generate
in interfaceorg.apereo.cas.authentication.principal.PersistentIdGenerator
-
generate
public java.lang.String generate(org.apereo.cas.authentication.principal.Principal principal, java.lang.String service)
- Specified by:
generate
in interfaceorg.apereo.cas.authentication.principal.PersistentIdGenerator
-
determinePrincipalIdFromAttributes
public java.lang.String determinePrincipalIdFromAttributes(java.lang.String defaultId, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> attributes)
Determine principal id from attributes.- Parameters:
defaultId
- the default idattributes
- the attributes- Returns:
- the string
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
digestAndEncodeWithSalt
protected java.lang.String digestAndEncodeWithSalt(java.security.MessageDigest md)
Digest and encode with salt string.- Parameters:
md
- the md- Returns:
- the string
-
prepareMessageDigest
protected static java.security.MessageDigest prepareMessageDigest(java.lang.String principal, java.lang.String service)
Prepare message digest message digest.- Parameters:
principal
- the principalservice
- the service- Returns:
- the message digest
-
-