Class DefaultCasProtocolAttributeEncoder

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

public class DefaultCasProtocolAttributeEncoder extends AbstractProtocolAttributeEncoder
The default implementation of the attribute encoder that will use a per-service key-pair to encrypt the credential password and PGT when available. All other attributes remain in place.
Since:
4.1
  • Constructor Details

    • DefaultCasProtocolAttributeEncoder

      public DefaultCasProtocolAttributeEncoder(org.apereo.cas.services.ServicesManager servicesManager, org.apereo.cas.util.crypto.CipherExecutor<String,String> cacheCredentialCipherExecutor)
      Instantiates a new Default cas attribute encoder.
      Parameters:
      servicesManager - the services manager
      cacheCredentialCipherExecutor - the cache credential cipher executor
    • DefaultCasProtocolAttributeEncoder

      public DefaultCasProtocolAttributeEncoder(org.apereo.cas.services.ServicesManager servicesManager, org.apereo.cas.services.RegisteredServiceCipherExecutor cipherExecutor, org.apereo.cas.util.crypto.CipherExecutor<String,String> cacheCredentialCipherExecutor)
      Instantiates a new Default cas attribute encoder.
      Parameters:
      servicesManager - the services manager
      cipherExecutor - the cipher executor
      cacheCredentialCipherExecutor - the cache credential cipher executor
  • Method Details

    • encodeAndEncryptCredentialPassword

      protected void encodeAndEncryptCredentialPassword(Map<String,Object> attributes, Map<String,String> cachedAttributesToEncode, org.apereo.cas.services.RegisteredServiceCipherExecutor cipher, org.apereo.cas.services.RegisteredService registeredService)
      Encode and encrypt credential password using the public key supplied by the service. The result is base64 encoded and put into the attributes collection again, overwriting the previous value.
      Parameters:
      attributes - the attributes
      cachedAttributesToEncode - the cached attributes to encode
      cipher - the cipher
      registeredService - the registered service
    • encodeAndEncryptProxyGrantingTicket

      protected void encodeAndEncryptProxyGrantingTicket(Map<String,Object> attributes, Map<String,String> cachedAttributesToEncode, org.apereo.cas.services.RegisteredServiceCipherExecutor cipher, org.apereo.cas.services.RegisteredService registeredService)
      Encode and encrypt pgt.
      Parameters:
      attributes - the attributes
      cachedAttributesToEncode - the cached attributes to encode
      cipher - the cipher
      registeredService - the registered service
    • encryptAndEncodeAndPutIntoAttributesMap

      protected void encryptAndEncodeAndPutIntoAttributesMap(Map<String,Object> attributes, Map<String,String> cachedAttributesToEncode, String cachedAttributeName, org.apereo.cas.services.RegisteredServiceCipherExecutor cipher, org.apereo.cas.services.RegisteredService registeredService)
      Encrypt, encode and put the attribute into attributes map.
      Parameters:
      attributes - the attributes
      cachedAttributesToEncode - the cached attributes to encode
      cachedAttributeName - the cached attribute name
      cipher - the cipher
      registeredService - the registered service
    • encodeAttributesInternal

      protected 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)
      Description copied from class: AbstractProtocolAttributeEncoder
      Initialize the cipher with the public key and then start to encrypt select attributes.
      Specified by:
      encodeAttributesInternal in class AbstractProtocolAttributeEncoder
      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