AuthProvider (Java Platform SE 8 ) (original) (raw)
- java.util.Dictionary<K,V>
- java.util.Hashtable<Object,Object>
- java.util.Properties
* * java.security.Provider
* * java.security.AuthProvider
- java.util.Properties
- java.util.Hashtable<Object,Object>
All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>
public abstract class AuthProvider
extends Provider
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
See Also:
Serialized Form
Nested Class Summary
* ### Nested classes/interfaces inherited from class java.security.[Provider](../../java/security/Provider.html "class in java.security") `[Provider.Service](../../java/security/Provider.Service.html "class in java.security")`
Field Summary
* ### Fields inherited from class java.util.[Properties](../../java/util/Properties.html "class in java.util") `[defaults](../../java/util/Properties.html#defaults)`
Constructor Summary
Constructors
Modifier Constructor Description protected AuthProvider(String name, double version,String info) Constructs a provider with the specified name, version number, and information. Method Summary
All Methods Instance Methods Abstract Methods
Modifier and Type Method Description abstract void login(Subject subject,CallbackHandler handler) Log in to this provider. abstract void logout() Log out from this provider. abstract void setCallbackHandler(CallbackHandler handler) Set a CallbackHandler. * ### Methods inherited from class java.security.[Provider](../../java/security/Provider.html "class in java.security") `[clear](../../java/security/Provider.html#clear--), [compute](../../java/security/Provider.html#compute-java.lang.Object-java.util.function.BiFunction-), [computeIfAbsent](../../java/security/Provider.html#computeIfAbsent-java.lang.Object-java.util.function.Function-), [computeIfPresent](../../java/security/Provider.html#computeIfPresent-java.lang.Object-java.util.function.BiFunction-), [elements](../../java/security/Provider.html#elements--), [entrySet](../../java/security/Provider.html#entrySet--), [forEach](../../java/security/Provider.html#forEach-java.util.function.BiConsumer-), [get](../../java/security/Provider.html#get-java.lang.Object-), [getInfo](../../java/security/Provider.html#getInfo--), [getName](../../java/security/Provider.html#getName--), [getOrDefault](../../java/security/Provider.html#getOrDefault-java.lang.Object-java.lang.Object-), [getProperty](../../java/security/Provider.html#getProperty-java.lang.String-), [getService](../../java/security/Provider.html#getService-java.lang.String-java.lang.String-), [getServices](../../java/security/Provider.html#getServices--), [getVersion](../../java/security/Provider.html#getVersion--), [keys](../../java/security/Provider.html#keys--), [keySet](../../java/security/Provider.html#keySet--), [load](../../java/security/Provider.html#load-java.io.InputStream-), [merge](../../java/security/Provider.html#merge-java.lang.Object-java.lang.Object-java.util.function.BiFunction-), [put](../../java/security/Provider.html#put-java.lang.Object-java.lang.Object-), [putAll](../../java/security/Provider.html#putAll-java.util.Map-), [putIfAbsent](../../java/security/Provider.html#putIfAbsent-java.lang.Object-java.lang.Object-), [putService](../../java/security/Provider.html#putService-java.security.Provider.Service-), [remove](../../java/security/Provider.html#remove-java.lang.Object-), [remove](../../java/security/Provider.html#remove-java.lang.Object-java.lang.Object-), [removeService](../../java/security/Provider.html#removeService-java.security.Provider.Service-), [replace](../../java/security/Provider.html#replace-java.lang.Object-java.lang.Object-), [replace](../../java/security/Provider.html#replace-java.lang.Object-java.lang.Object-java.lang.Object-), [replaceAll](../../java/security/Provider.html#replaceAll-java.util.function.BiFunction-), [toString](../../java/security/Provider.html#toString--), [values](../../java/security/Provider.html#values--)` * ### Methods inherited from class java.util.[Properties](../../java/util/Properties.html "class in java.util") `[getProperty](../../java/util/Properties.html#getProperty-java.lang.String-java.lang.String-), [list](../../java/util/Properties.html#list-java.io.PrintStream-), [list](../../java/util/Properties.html#list-java.io.PrintWriter-), [load](../../java/util/Properties.html#load-java.io.Reader-), [loadFromXML](../../java/util/Properties.html#loadFromXML-java.io.InputStream-), [propertyNames](../../java/util/Properties.html#propertyNames--), [save](../../java/util/Properties.html#save-java.io.OutputStream-java.lang.String-), [setProperty](../../java/util/Properties.html#setProperty-java.lang.String-java.lang.String-), [store](../../java/util/Properties.html#store-java.io.OutputStream-java.lang.String-), [store](../../java/util/Properties.html#store-java.io.Writer-java.lang.String-), [storeToXML](../../java/util/Properties.html#storeToXML-java.io.OutputStream-java.lang.String-), [storeToXML](../../java/util/Properties.html#storeToXML-java.io.OutputStream-java.lang.String-java.lang.String-), [stringPropertyNames](../../java/util/Properties.html#stringPropertyNames--)` * ### Methods inherited from class java.util.[Hashtable](../../java/util/Hashtable.html "class in java.util") `[clone](../../java/util/Hashtable.html#clone--), [contains](../../java/util/Hashtable.html#contains-java.lang.Object-), [containsKey](../../java/util/Hashtable.html#containsKey-java.lang.Object-), [containsValue](../../java/util/Hashtable.html#containsValue-java.lang.Object-), [equals](../../java/util/Hashtable.html#equals-java.lang.Object-), [hashCode](../../java/util/Hashtable.html#hashCode--), [isEmpty](../../java/util/Hashtable.html#isEmpty--), [rehash](../../java/util/Hashtable.html#rehash--), [size](../../java/util/Hashtable.html#size--)` * ### Methods inherited from class java.lang.[Object](../../java/lang/Object.html "class in java.lang") `[finalize](../../java/lang/Object.html#finalize--), [getClass](../../java/lang/Object.html#getClass--), [notify](../../java/lang/Object.html#notify--), [notifyAll](../../java/lang/Object.html#notifyAll--), [wait](../../java/lang/Object.html#wait--), [wait](../../java/lang/Object.html#wait-long-), [wait](../../java/lang/Object.html#wait-long-int-)`
Constructor Detail
* #### AuthProvider protected AuthProvider([String](../../java/lang/String.html "class in java.lang") name, double version, [String](../../java/lang/String.html "class in java.lang") info) Constructs a provider with the specified name, version number, and information. Parameters: `name` \- the provider name. `version` \- the provider version number. `info` \- a description of the provider and its services.
Method Detail
* #### login public abstract void login([Subject](../../javax/security/auth/Subject.html "class in javax.security.auth") subject, [CallbackHandler](../../javax/security/auth/callback/CallbackHandler.html "interface in javax.security.auth.callback") handler) throws [LoginException](../../javax/security/auth/login/LoginException.html "class in javax.security.auth.login") 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` \- 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` \- the `CallbackHandler` used by this provider to obtain authentication information from the caller, which may be `null` Throws: `[LoginException](../../javax/security/auth/login/LoginException.html "class in javax.security.auth.login")` \- if the login operation fails `[SecurityException](../../java/lang/SecurityException.html "class in java.lang")` \- 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 * #### logout public abstract void logout() throws [LoginException](../../javax/security/auth/login/LoginException.html "class in javax.security.auth.login") Log out from this provider. Throws: `[LoginException](../../javax/security/auth/login/LoginException.html "class in javax.security.auth.login")` \- if the logout operation fails `[SecurityException](../../java/lang/SecurityException.html "class in java.lang")` \- 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 * #### setCallbackHandler public abstract void setCallbackHandler([CallbackHandler](../../javax/security/auth/callback/CallbackHandler.html "interface in javax.security.auth.callback") 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` \- a `CallbackHandler` for obtaining authentication information, which may be `null` Throws: `[SecurityException](../../java/lang/SecurityException.html "class in java.lang")` \- 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
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, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.