Uses of Class javax.security.auth.login.LoginException (Java Platform SE 8 )
Date: 2026-03-16

## Uses of Class
javax.security.auth.login.LoginException

- Packages that use LoginException
  Package | Description
  --- | ---
  java.security | Provides the classes and interfaces for the security framework.
  javax.security.auth.login | This package provides a pluggable authentication framework.
  javax.security.auth.spi | This package provides the interface to be used for implementing pluggable authentication modules.

- - ### Uses of LoginException in java.security

    Methods in java.security that throw LoginException
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | AuthProvider.`login(Subject subject, CallbackHandler handler)` Log in to this provider.
    `abstract void` | AuthProvider.`logout()` Log out from this provider.

  - ### Uses of LoginException in javax.security.auth.login

    Subclasses of LoginException in javax.security.auth.login
    Modifier and Type | Class and Description
    --- | ---
    `class` | `AccountException` A generic account exception.
    `class` | `AccountExpiredException` Signals that a user account has expired.
    `class` | `AccountLockedException` Signals that an account was locked.
    `class` | `AccountNotFoundException` Signals that an account was not found.
    `class` | `CredentialException` A generic credential exception.
    `class` | `CredentialExpiredException` Signals that a `Credential` has expired.
    `class` | `CredentialNotFoundException` Signals that a credential was not found.
    `class` | `FailedLoginException` Signals that user authentication failed.

    Methods in javax.security.auth.login that throw LoginException
    Modifier and Type | Method and Description
    --- | ---
    `void` | LoginContext.`login()` Perform the authentication.
    `void` | LoginContext.`logout()` Logout the `Subject`.

    Constructors in javax.security.auth.login that throw LoginException
    Constructor and Description
    `LoginContext(String name)` Instantiate a new `LoginContext` object with a name.
    `LoginContext(String name, CallbackHandler callbackHandler)` Instantiate a new `LoginContext` object with a name and a `CallbackHandler` object.
    `LoginContext(String name, Subject subject)` Instantiate a new `LoginContext` object with a name and a `Subject` object.
    `LoginContext(String name, Subject subject, CallbackHandler callbackHandler)` Instantiate a new `LoginContext` object with a name, a `Subject` to be authenticated, and a `CallbackHandler` object.
    `LoginContext(String name, Subject subject, CallbackHandler callbackHandler, Configuration config)` Instantiate a new `LoginContext` object with a name, a `Subject` to be authenticated, a `CallbackHandler` object, and a login `Configuration`.

  - ### Uses of LoginException in javax.security.auth.spi

    Methods in javax.security.auth.spi that throw LoginException
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | LoginModule.`abort()` Method to abort the authentication process (phase 2).
    `boolean` | LoginModule.`commit()` Method to commit the authentication process (phase 2).
    `boolean` | LoginModule.`login()` Method to authenticate a `Subject` (phase 1).
    `boolean` | LoginModule.`logout()` Method which logs out a `Subject`.

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.