Class 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
    • 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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.apereo.cas.authentication.principal.PersistentIdGenerator

        generate, generate, generate
    • Constructor Detail

      • ShibbolethCompatiblePersistentIdGenerator

        public ShibbolethCompatiblePersistentIdGenerator​(java.lang.String salt)
    • Method Detail

      • generate

        public java.lang.String generate​(java.lang.String principal,
                                         java.lang.String service)
        Specified by:
        generate in interface org.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 interface org.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 id
        attributes - the attributes
        Returns:
        the string
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.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 principal
        service - the service
        Returns:
        the message digest