org.apache.jetspeed.security.spi.impl
Class EncodePasswordOnFirstLoadInterceptor

java.lang.Object
  extended byorg.apache.jetspeed.security.spi.impl.AbstractInternalPasswordCredentialInterceptorImpl
      extended byorg.apache.jetspeed.security.spi.impl.EncodePasswordOnFirstLoadInterceptor
All Implemented Interfaces:
InternalPasswordCredentialInterceptor

public class EncodePasswordOnFirstLoadInterceptor
extends AbstractInternalPasswordCredentialInterceptorImpl

Encodes (encrypts) an InternalCredential password using the configured encoder if it is loaded unencoded from the persistent store.

This interceptor is useful when credentials need to be preset in the persistent store (like through scripts) or migrated unencoded from a different storage.

Version:
$Id$
Author:
Ate Douma

Constructor Summary
EncodePasswordOnFirstLoadInterceptor()
           
 
Method Summary
 boolean afterLoad(PasswordCredentialProvider pcProvider, String userName, org.apache.jetspeed.security.om.InternalCredential credential)
           Invoked after a password credential is loaded from the persistent store.
 
Methods inherited from class org.apache.jetspeed.security.spi.impl.AbstractInternalPasswordCredentialInterceptorImpl
afterAuthenticated, beforeCreate, beforeSetPassword
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncodePasswordOnFirstLoadInterceptor

public EncodePasswordOnFirstLoadInterceptor()
Method Detail

afterLoad

public boolean afterLoad(PasswordCredentialProvider pcProvider,
                         String userName,
                         org.apache.jetspeed.security.om.InternalCredential credential)
                  throws org.apache.jetspeed.security.SecurityException
Description copied from interface: InternalPasswordCredentialInterceptor

Invoked after a password credential is loaded from the persistent store.

If true is returned the credential is expected to be updated and its changes will be stored again.

A thrown SecurityException will be logged as an error and result in the credential to be ignored as if not existing (like for authentication).

Specified by:
afterLoad in interface InternalPasswordCredentialInterceptor
Overrides:
afterLoad in class AbstractInternalPasswordCredentialInterceptorImpl
Returns:
true if now encoded
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
InternalPasswordCredentialInterceptor.afterLoad(org.apache.jetspeed.security.spi.PasswordCredentialProvider, java.lang.String, org.apache.jetspeed.security.om.InternalCredential)


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.