protected void encodeAndEncryptCredentialPassword ( final Map < String , Object > attributes , final Map < String , String > cachedAttributesToEncode , final RegisteredServiceCipherExecutor cipher , final RegisteredService registeredService ) { if ( cachedAttributesToEncode . containsKey ( CasViewConstants . MODEL_ATTRIBUTE_NAME_PRINCIPAL_CREDENTIAL ) ) { val value = cachedAttributesToEncode . get ( CasViewConstants . MODEL_ATTRIBUTE_NAME_PRINCIPAL_CREDENTIAL ) ; val decodedValue = this . cacheCredentialCipherExecutor . decode ( value , ArrayUtils . EMPTY_OBJECT_ARRAY ) ; cachedAttributesToEncode . remove ( CasViewConstants . MODEL_ATTRIBUTE_NAME_PRINCIPAL_CREDENTIAL ) ; if ( StringUtils . isNotBlank ( decodedValue ) ) { cachedAttributesToEncode . put ( CasViewConstants . MODEL_ATTRIBUTE_NAME_PRINCIPAL_CREDENTIAL , decodedValue ) ; } } encryptAndEncodeAndPutIntoAttributesMap ( attributes , cachedAttributesToEncode , CasViewConstants . MODEL_ATTRIBUTE_NAME_PRINCIPAL_CREDENTIAL , cipher , 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 .