Java in a Nutshell, 5th Edition [Electronic resources]

نسخه متنی -صفحه : 1191/ 491
نمايش فراداده

This subclass of Provider defines methods that allow users to "log in" before using the provider's services. An implementation of the login( ) method should use the supplied javax.security.auth.callback.CallbackHandler class to request the user's password or other authentication credentials. If no callback handler is passed to login( ), it should use the one registered with setCallbackHandler( ) or a default.

Figure 14-3. java.security.AuthProvider

public abstract class 

AuthProvider extends Provider { // Protected Constructors protected

AuthProvider (String

name , double

version , String

info ); // Public Instance Methods public abstract void

login (javax.security.auth.Subject

subject , javax. security.auth.callback.CallbackHandler

handler ) throws javax.security.auth.login.LoginException; public abstract void

logout ( ) throws javax.security.auth.login.LoginException; public abstract void

setCallbackHandler (javax.security.auth.callback. CallbackHandler

handler ); }