Class AbstractProtocolAttributeEncoder

  • All Implemented Interfaces:
    org.apereo.cas.authentication.ProtocolAttributeEncoder
    Direct Known Subclasses:
    DefaultCasProtocolAttributeEncoder

    public abstract class AbstractProtocolAttributeEncoder
    extends java.lang.Object
    implements org.apereo.cas.authentication.ProtocolAttributeEncoder
    Abstract class to define common attribute encoding operations.
    Since:
    4.1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.apereo.cas.services.ServicesManager servicesManager
      The Services manager.
      • Fields inherited from interface org.apereo.cas.authentication.ProtocolAttributeEncoder

        ENCODED_ATTRIBUTE_PREFIX, LOGGER
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.Object> encodeAttributes​(java.util.Map<java.lang.String,​java.lang.Object> attributes, org.apereo.cas.services.RegisteredService registeredService)  
      protected abstract void encodeAttributesInternal​(java.util.Map<java.lang.String,​java.lang.Object> attributes, java.util.Map<java.lang.String,​java.lang.String> cachedAttributesToEncode, org.apereo.cas.services.RegisteredServiceCipherExecutor cipher, org.apereo.cas.services.RegisteredService registeredService)
      Initialize the cipher with the public key and then start to encrypt select attributes.
      protected java.util.Map<java.lang.String,​java.lang.String> initialize​(java.util.Map<java.lang.String,​java.lang.Object> attributes)
      Initialize the encoding process.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • servicesManager

        protected final org.apereo.cas.services.ServicesManager servicesManager
        The Services manager.
    • Constructor Detail

      • AbstractProtocolAttributeEncoder

        public AbstractProtocolAttributeEncoder()
    • Method Detail

      • encodeAttributes

        public java.util.Map<java.lang.String,​java.lang.Object> encodeAttributes​(java.util.Map<java.lang.String,​java.lang.Object> attributes,
                                                                                       org.apereo.cas.services.RegisteredService registeredService)
        Specified by:
        encodeAttributes in interface org.apereo.cas.authentication.ProtocolAttributeEncoder
      • encodeAttributesInternal

        protected abstract void encodeAttributesInternal​(java.util.Map<java.lang.String,​java.lang.Object> attributes,
                                                         java.util.Map<java.lang.String,​java.lang.String> cachedAttributesToEncode,
                                                         org.apereo.cas.services.RegisteredServiceCipherExecutor cipher,
                                                         org.apereo.cas.services.RegisteredService registeredService)
        Initialize the cipher with the public key and then start to encrypt select attributes.
        Parameters:
        attributes - the attributes
        cachedAttributesToEncode - the cached attributes to encode
        cipher - the cipher object initialized per service public key
        registeredService - the registered service
      • initialize

        protected java.util.Map<java.lang.String,​java.lang.String> initialize​(java.util.Map<java.lang.String,​java.lang.Object> attributes)
        Initialize the encoding process. Removes the CasViewConstants.MODEL_ATTRIBUTE_NAME_PRINCIPAL_CREDENTIAL and CasViewConstants.MODEL_ATTRIBUTE_NAME_PROXY_GRANTING_TICKET from the authentication attributes originally and into a cache object, so it can later on be encrypted if needed.
        Parameters:
        attributes - the new encoded attributes
        Returns:
        a map of attributes that are to be encoded and encrypted