Class ShibbolethCompatiblePersistentIdGenerator

java.lang.Object
org.apereo.cas.authentication.principal.ShibbolethCompatiblePersistentIdGenerator
All Implemented Interfaces:
Serializable, org.apereo.cas.authentication.principal.PersistentIdGenerator

public class ShibbolethCompatiblePersistentIdGenerator extends 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:
  • Constructor Details

    • ShibbolethCompatiblePersistentIdGenerator

      public ShibbolethCompatiblePersistentIdGenerator(String salt)
  • Method Details

    • prepareMessageDigest

      protected static MessageDigest prepareMessageDigest(String principal, String service)
      Prepare message digest message digest.
      Parameters:
      principal - the principal
      service - the service
      Returns:
      the message digest
    • generate

      public String generate(String principal, String service)
      Specified by:
      generate in interface org.apereo.cas.authentication.principal.PersistentIdGenerator
    • generate

      public String generate(org.apereo.cas.authentication.principal.Principal principal, String service)
      Specified by:
      generate in interface org.apereo.cas.authentication.principal.PersistentIdGenerator
    • determinePrincipalIdFromAttributes

      public String determinePrincipalIdFromAttributes(String defaultId, Map<String,List<Object>> attributes)
      Determine principal id from attributes.
      Parameters:
      defaultId - the default id
      attributes - the attributes
      Returns:
      the string
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • digestAndEncodeWithSalt

      protected String digestAndEncodeWithSalt(MessageDigest md)
      Digest and encode with salt string.
      Parameters:
      md - the md
      Returns:
      the string