Top Description Fields Constructors Methods
java.security

public abstract Class AuthProvider

extends Provider
Class Inheritance
Imports
javax.security.auth.Subject, javax.security.auth.login.LoginException, javax.security.auth.callback.CallbackHandler

This class defines login and logout methods for a provider.

While callers may invoke login directly, the provider may also invoke login on behalf of callers if it determines that a login must be performed prior to certain operations.

Since
1.5

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
protected
AuthProvider(String
the provider name.
name
,
double
the provider version number.
version
,
String
a description of the provider and its services.
info
)
Deprecated since 9. use AuthProvider(String, String, String) instead.

Constructs a provider with the specified name, version number, and information.

protected
AuthProvider(String
the provider name.
name
,
String
the provider version string.
versionStr
,
String
a description of the provider and its services.
info
)

Constructs a provider with the specified name, version string, and information.

Method Summary

Modifier and TypeMethod and Description
public abstract void
login(Subject
the Subject which may contain principals/credentials used for authentication, or may be populated with additional principals/credentials after successful authentication has completed. This parameter may be null.
subject
,
CallbackHandler
the CallbackHandler used by this provider to obtain authentication information from the caller, which may be null
handler
)

Log in to this provider.

public abstract void
logout()

Log out from this provider.

public abstract void
setCallbackHandler(CallbackHandler
a CallbackHandler for obtaining authentication information, which may be null
handler
)

Set a CallbackHandler.

Inherited from java.security.Provider:
clearcomputecomputeIfAbsentcomputeIfPresentconfigureelementsentrySetforEachgetgetDefaultSecureRandomServicegetInfogetNamegetOrDefaultgetPropertygetServicegetServicesgetVersiongetVersionStrisConfiguredkeyskeySetloadmergeputputAllputIfAbsentputServiceremoveremoveremoveServicereplacereplacereplaceAlltoStringvalues

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.security.Provider.serialVersionUID.

Annotations
@Serial

Constructor Detail

AuthProviderback to summary
protected AuthProvider(String name, double version, String info)

Deprecated

since 9.

use AuthProvider(String, String, String) instead.

Constructs a provider with the specified name, version number, and information.

Parameters
name:String

the provider name.

version:double

the provider version number.

info:String

a description of the provider and its services.

Annotations
@Deprecated
since:9
AuthProviderback to summary
protected AuthProvider(String name, String versionStr, String info)

Constructs a provider with the specified name, version string, and information.

Parameters
name:String

the provider name.

versionStr:String

the provider version string.

info:String

a description of the provider and its services.

Since
9

Method Detail

loginback to summary
public abstract void login(Subject subject, CallbackHandler handler) throws LoginException

Log in to this provider.

The provider relies on a CallbackHandler to obtain authentication information from the caller (a PIN, for example). If the caller passes a null handler to this method, the provider uses the handler set in the setCallbackHandler method. If no handler was set in that method, the provider queries the auth.login.defaultCallbackHandler security property for the fully qualified class name of a default handler implementation. If the security property is not set, the provider is assumed to have alternative means for obtaining authentication information.

Parameters
subject:Subject

the Subject which may contain principals/credentials used for authentication, or may be populated with additional principals/credentials after successful authentication has completed. This parameter may be null.

handler:CallbackHandler

the CallbackHandler used by this provider to obtain authentication information from the caller, which may be null

Exceptions
LoginException:
if the login operation fails
IllegalStateException:
if the provider requires configuration and configure has not been called
SecurityException:
if the caller does not pass a security check for SecurityPermission("authProvider.name"), where name is the value returned by this provider's getName method
logoutback to summary
public abstract void logout() throws LoginException

Log out from this provider.

Exceptions
LoginException:
if the logout operation fails
IllegalStateException:
if the provider requires configuration and configure has not been called
SecurityException:
if the caller does not pass a security check for SecurityPermission("authProvider.name"), where name is the value returned by this provider's getName method
setCallbackHandlerback to summary
public abstract void setCallbackHandler(CallbackHandler handler)

Set a CallbackHandler.

The provider uses this handler if one is not passed to the login method. The provider also uses this handler if it invokes login on behalf of callers. In either case if a handler is not set via this method, the provider queries the auth.login.defaultCallbackHandler security property for the fully qualified class name of a default handler implementation. If the security property is not set, the provider is assumed to have alternative means for obtaining authentication information.

Parameters
handler:CallbackHandler

a CallbackHandler for obtaining authentication information, which may be null

Exceptions
IllegalStateException:
if the provider requires configuration and configure has not been called
SecurityException:
if the caller does not pass a security check for SecurityPermission("authProvider.name"), where name is the value returned by this provider's getName method