Class AbstractProtocolAttributeEncoder

java.lang.Object
org.apereo.cas.authentication.support.AbstractProtocolAttributeEncoder
All Implemented Interfaces:
org.apereo.cas.authentication.ProtocolAttributeEncoder
Direct Known Subclasses:
DefaultCasProtocolAttributeEncoder

public abstract class AbstractProtocolAttributeEncoder extends 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 final org.apereo.cas.services.ServicesManager
    The Services manager.

    Fields inherited from interface org.apereo.cas.authentication.ProtocolAttributeEncoder

    ENCODED_ATTRIBUTE_PREFIX, LOGGER
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    encodeAttributes(Map<String,Object> attributes, org.apereo.cas.services.RegisteredService registeredService, org.apereo.cas.authentication.principal.WebApplicationService webApplicationService)
     
    protected abstract void
    encodeAttributesInternal(Map<String,Object> attributes, Map<String,String> cachedAttributesToEncode, org.apereo.cas.services.RegisteredServiceCipherExecutor cipher, org.apereo.cas.services.RegisteredService registeredService, org.apereo.cas.authentication.principal.WebApplicationService webApplicationService)
    Initialize the cipher with the public key and then start to encrypt select attributes.
    protected Map<String,String>
    initialize(Map<String,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 Details

    • servicesManager

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

    • AbstractProtocolAttributeEncoder

      public AbstractProtocolAttributeEncoder()
  • Method Details

    • encodeAttributes

      public Map<String,Object> encodeAttributes(Map<String,Object> attributes, org.apereo.cas.services.RegisteredService registeredService, org.apereo.cas.authentication.principal.WebApplicationService webApplicationService)
      Specified by:
      encodeAttributes in interface org.apereo.cas.authentication.ProtocolAttributeEncoder
    • encodeAttributesInternal

      protected abstract void encodeAttributesInternal(Map<String,Object> attributes, Map<String,String> cachedAttributesToEncode, org.apereo.cas.services.RegisteredServiceCipherExecutor cipher, org.apereo.cas.services.RegisteredService registeredService, org.apereo.cas.authentication.principal.WebApplicationService webApplicationService)
      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
      webApplicationService - the web application service
    • initialize

      protected Map<String,String> initialize(Map<String,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