Name

Class javax.security.auth.login.LoginContext

Synopsis

This class is used to authenticate a user. You create an instance of this class (perhaps supplying an appropriate callback handler and/or subject) and then invoke the login( ) method to authenticate the user. If that succeeds, the user may be retrieved with the getSubject( ) method; that subject is then generally passed to the Subject.doAs( ) method.

Class Definition

public class javax.security.auth.login.LoginContext
    extends java.lang.Object {

    // Constructors
    public LoginContext(String, Subject, CallbackHandler);
    public LoginContext(String);
    public LoginContext(String, Subject);
    public LoginContext(String, CallbackHandler);

    // Instance Methods
    public Subject getSubject(  );
    public void login(  );
    public void 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.