Name

Interface javax.security.auth.spi.LoginModule

Synopsis

If you want to write your own login module, you implement this interface and then list the appropriate class in the login configuration file. The login( ) method should authenticate the user (perhaps requiring a callback). However, since other modules may be in use, the user is not fully authenticated until all modules pass. When that happens, the commit( ) method is called, at which point the module should add the appropriate Subject object to the set of principals. If one or more modules failed, then the abort( ) method is called instead, at which point the module should clean up its internal state.

Interface Definition

public abstract interface javax.security.auth.spi.LoginModule {

    // Instance Methods
    public abstract boolean abort(  );
    public abstract boolean commit(  );
    public abstract void initialize(Subject, CallbackHandler,
                                    Map, Map);
    public abstract boolean login(  );
    public abstract boolean logout(  );
}

Get Java Security, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.