java.security
Class AuthProvider

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.util.Dictionary sample code for java.util.Dictionary definition code for java.util.Dictionary <K,V>
      extended by java.util.Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable <Object sample code for java.lang.Object definition code for java.lang.Object ,Object sample code for java.lang.Object definition code for java.lang.Object >
          extended by java.util.Properties sample code for java.util.Properties definition code for java.util.Properties 
              extended by java.security.Provider sample code for java.security.Provider definition code for java.security.Provider 
                  extended by java.security.AuthProvider
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable , Map sample code for java.util.Map definition code for java.util.Map <Object sample code for java.lang.Object definition code for java.lang.Object ,Object sample code for java.lang.Object definition code for java.lang.Object >

public abstract class AuthProvider
extends Provider sample code for java.security.Provider definition code for java.security.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 sample code for java.security.Provider definition code for java.security.Provider
Provider.Service sample code for java.security.Provider.Service definition code for java.security.Provider.Service
 
Field Summary
 
Fields inherited from class java.util.Properties sample code for java.util.Properties definition code for java.util.Properties
defaults sample code for java.util.Properties.defaults definition code for java.util.Properties.defaults
 
Constructor Summary
protected AuthProvider sample code for java.security.AuthProvider.AuthProvider(java.lang.String, double, java.lang.String) definition code for java.security.AuthProvider.AuthProvider(java.lang.String, double, java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  name, double version, String sample code for java.lang.String definition code for java.lang.String  info)
          Constructs a provider with the specified name, version number, and information.
 
Method Summary
abstract  void login sample code for java.security.AuthProvider.login(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler) definition code for java.security.AuthProvider.login(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler) (Subject sample code for javax.security.auth.Subject definition code for javax.security.auth.Subject  subject, CallbackHandler sample code for javax.security.auth.callback.CallbackHandler definition code for javax.security.auth.callback.CallbackHandler  handler)
          Log in to this provider.
abstract  void logout sample code for java.security.AuthProvider.logout() definition code for java.security.AuthProvider.logout() ()
          Log out from this provider.
abstract  void setCallbackHandler sample code for java.security.AuthProvider.setCallbackHandler(javax.security.auth.callback.CallbackHandler) definition code for java.security.AuthProvider.setCallbackHandler(javax.security.auth.callback.CallbackHandler) (CallbackHandler sample code for javax.security.auth.callback.CallbackHandler definition code for javax.security.auth.callback.CallbackHandler  handler)
          Set a CallbackHandler.
 
Methods inherited from class java.security.Provider sample code for java.security.Provider definition code for java.security.Provider
clear sample code for java.security.Provider.clear() definition code for java.security.Provider.clear() , entrySet sample code for java.security.Provider.entrySet() definition code for java.security.Provider.entrySet() , getInfo sample code for java.security.Provider.getInfo() definition code for java.security.Provider.getInfo() , getName sample code for java.security.Provider.getName() definition code for java.security.Provider.getName() , getService sample code for java.security.Provider.getService(java.lang.String, java.lang.String) definition code for java.security.Provider.getService(java.lang.String, java.lang.String) , getServices sample code for java.security.Provider.getServices() definition code for java.security.Provider.getServices() , getVersion sample code for java.security.Provider.getVersion() definition code for java.security.Provider.getVersion() , keySet sample code for java.security.Provider.keySet() definition code for java.security.Provider.keySet() , load sample code for java.security.Provider.load(java.io.InputStream) definition code for java.security.Provider.load(java.io.InputStream) , put sample code for java.security.Provider.put(java.lang.Object, java.lang.Object) definition code for java.security.Provider.put(java.lang.Object, java.lang.Object) , putAll sample code for java.security.Provider.putAll(java.util.Map) definition code for java.security.Provider.putAll(java.util.Map) , putService sample code for java.security.Provider.putService(java.security.Provider.Service) definition code for java.security.Provider.putService(java.security.Provider.Service) , remove sample code for java.security.Provider.remove(java.lang.Object) definition code for java.security.Provider.remove(java.lang.Object) , removeService sample code for java.security.Provider.removeService(java.security.Provider.Service) definition code for java.security.Provider.removeService(java.security.Provider.Service) , toString sample code for java.security.Provider.toString() definition code for java.security.Provider.toString() , values sample code for java.security.Provider.values() definition code for java.security.Provider.values()
 
Methods inherited from class java.util.Properties sample code for java.util.Properties definition code for java.util.Properties
getProperty sample code for java.util.Properties.getProperty(java.lang.String) definition code for java.util.Properties.getProperty(java.lang.String) , getProperty sample code for java.util.Properties.getProperty(java.lang.String, java.lang.String) definition code for java.util.Properties.getProperty(java.lang.String, java.lang.String) , list sample code for java.util.Properties.list(java.io.PrintStream) definition code for java.util.Properties.list(java.io.PrintStream) , list sample code for java.util.Properties.list(java.io.PrintWriter) definition code for java.util.Properties.list(java.io.PrintWriter) , loadFromXML sample code for java.util.Properties.loadFromXML(java.io.InputStream) definition code for java.util.Properties.loadFromXML(java.io.InputStream) , propertyNames sample code for java.util.Properties.propertyNames() definition code for java.util.Properties.propertyNames() , save sample code for java.util.Properties.save(java.io.OutputStream, java.lang.String) definition code for java.util.Properties.save(java.io.OutputStream, java.lang.String) , setProperty sample code for java.util.Properties.setProperty(java.lang.String, java.lang.String) definition code for java.util.Properties.setProperty(java.lang.String, java.lang.String) , store sample code for java.util.Properties.store(java.io.OutputStream, java.lang.String) definition code for java.util.Properties.store(java.io.OutputStream, java.lang.String) , storeToXML sample code for java.util.Properties.storeToXML(java.io.OutputStream, java.lang.String) definition code for java.util.Properties.storeToXML(java.io.OutputStream, java.lang.String) , storeToXML sample code for java.util.Properties.storeToXML(java.io.OutputStream, java.lang.String, java.lang.String) definition code for java.util.Properties.storeToXML(java.io.OutputStream, java.lang.String, java.lang.String)
 
Methods inherited from class java.util.Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable
clone sample code for java.util.Hashtable.clone() definition code for java.util.Hashtable.clone() , contains sample code for java.util.Hashtable.contains(java.lang.Object) definition code for java.util.Hashtable.contains(java.lang.Object) , containsKey sample code for java.util.Hashtable.containsKey(java.lang.Object) definition code for java.util.Hashtable.containsKey(java.lang.Object) , containsValue sample code for java.util.Hashtable.containsValue(java.lang.Object) definition code for java.util.Hashtable.containsValue(java.lang.Object) , elements sample code for java.util.Hashtable.elements() definition code for java.util.Hashtable.elements() , equals sample code for java.util.Hashtable.equals(java.lang.Object) definition code for java.util.Hashtable.equals(java.lang.Object) , get sample code for java.util.Hashtable.get(java.lang.Object) definition code for java.util.Hashtable.get(java.lang.Object) , hashCode sample code for java.util.Hashtable.hashCode() definition code for java.util.Hashtable.hashCode() , isEmpty sample code for java.util.Hashtable.isEmpty() definition code for java.util.Hashtable.isEmpty() , keys sample code for java.util.Hashtable.keys() definition code for java.util.Hashtable.keys() , rehash sample code for java.util.Hashtable.rehash() definition code for java.util.Hashtable.rehash() , size sample code for java.util.Hashtable.size() definition code for java.util.Hashtable.size()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

AuthProvider sample code for java.security.AuthProvider(java.lang.String, double, java.lang.String) definition code for java.security.AuthProvider(java.lang.String, double, java.lang.String)

protected AuthProvider(String sample code for java.lang.String definition code for java.lang.String  name,
                       double version,
                       String sample code for java.lang.String definition code for java.lang.String  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 sample code for java.security.AuthProvider.login(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler) definition code for java.security.AuthProvider.login(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler)

public abstract void login(Subject sample code for javax.security.auth.Subject definition code for javax.security.auth.Subject  subject,
                           CallbackHandler sample code for javax.security.auth.callback.CallbackHandler definition code for javax.security.auth.callback.CallbackHandler  handler)
                    throws LoginException sample code for javax.security.auth.login.LoginException definition code for javax.security.auth.login.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 - 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 sample code for javax.security.auth.login.LoginException definition code for javax.security.auth.login.LoginException - if the login operation fails
SecurityException sample code for java.lang.SecurityException definition code for java.lang.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

logout sample code for java.security.AuthProvider.logout() definition code for java.security.AuthProvider.logout()

public abstract void logout()
                     throws LoginException sample code for javax.security.auth.login.LoginException definition code for javax.security.auth.login.LoginException 
Log out from this provider.

Throws:
LoginException sample code for javax.security.auth.login.LoginException definition code for javax.security.auth.login.LoginException - if the logout operation fails
SecurityException sample code for java.lang.SecurityException definition code for java.lang.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

setCallbackHandler sample code for java.security.AuthProvider.setCallbackHandler(javax.security.auth.callback.CallbackHandler) definition code for java.security.AuthProvider.setCallbackHandler(javax.security.auth.callback.CallbackHandler)

public abstract void setCallbackHandler(CallbackHandler sample code for javax.security.auth.callback.CallbackHandler definition code for javax.security.auth.callback.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 - a CallbackHandler for obtaining authentication information, which may be null
Throws:
SecurityException sample code for java.lang.SecurityException definition code for java.lang.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