RADIUS Client API (V3)

com.theorem.radius3.login
Class RADIUSLogin

Object
  extended byRADIUSLogin
All Implemented Interfaces:
LoginModule

public final class RADIUSLogin
extends Object
implements LoginModule

The RADIUSLogin uses a RADIUS client to authenticate using the Java Authtnication and Authorization Service (JAAS).

See the file RADIUSLogin.config for a description of the options.

The following Callbacks are implemented: AccessAccept, AccessBadPacket, AccessChallenge, AccessReject, ClientException, RADIUSCallback, RADIUSConfirmationCallback, RADIUSNameCallback, RADIUSPasswordCallback, RADIUSTextInputCallback, RADIUSTextOutputCallback, SetAccessRequestAttributes.


Field Summary
static String AUTH_CHAP
          "CHAP" Authentication
static String AUTH_EAPMD5
          "EAPMD5" Authentication
static String AUTH_MSCHAP
          "MSCHAP" Authentication
static String AUTH_MSCHAP2
          "MSCHAP2" Authentication
static String AUTH_PAP
          "PAP" Authentication
 
Constructor Summary
RADIUSLogin()
           
 
Method Summary
 boolean abort()
          Abort is called if the LoginContext's overall authentication failed.
 boolean commit()
          Commit this authentication.
 void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options)
          Initialize a few things.
 boolean login()
          Authenticate the entity.
 boolean logout()
          Logout the user.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTH_PAP

public static final String AUTH_PAP
"PAP" Authentication

See Also:
Constant Field Values

AUTH_CHAP

public static final String AUTH_CHAP
"CHAP" Authentication

See Also:
Constant Field Values

AUTH_MSCHAP

public static final String AUTH_MSCHAP
"MSCHAP" Authentication

See Also:
Constant Field Values

AUTH_MSCHAP2

public static final String AUTH_MSCHAP2
"MSCHAP2" Authentication

See Also:
Constant Field Values

AUTH_EAPMD5

public static final String AUTH_EAPMD5
"EAPMD5" Authentication

See Also:
Constant Field Values
Constructor Detail

RADIUSLogin

public RADIUSLogin()
Method Detail

initialize

public void initialize(Subject subject,
                       CallbackHandler callbackHandler,
                       Map sharedState,
                       Map options)
Initialize a few things.

Specified by:
initialize in interface LoginModule
Parameters:
subject - the Subject to be authenticated.
callbackHandler - a CallbackHandler.
sharedState - shared LoginModule state.
options - options specified in the login configuration file.

login

public boolean login()
              throws LoginException
Authenticate the entity.

Specified by:
login in interface LoginModule
Returns:
true since this LoginModule should not be ignored.
Throws:
FailedLoginException - if the authentication fails.
LoginException - if this LoginModule is unable to perform the authentication. This may result from configuration file errors, RADIUS communication problems, and actual RADIUS authentication errors.

commit

public boolean commit()
               throws LoginException
Commit this authentication. This is called if the LoginContext's overall authentication was succesful If this LoginModule's own authentication attempt succeeded (checked by retrieving the private state saved by the login() method), then this method associates a RADIUSPrincipal with the Subject passed to the RADIUSLogin module. If the RADIUSLogin's authentication attempt failed, then remove any state that was originally saved.

Specified by:
commit in interface LoginModule
Returns:
true if the RADIUSLogin module's own login and commit attempts succeeded, or false otherwise.
Throws:
LoginException - if the commit fails.

abort

public boolean abort()
              throws LoginException
Abort is called if the LoginContext's overall authentication failed. If the RADIUSLogin module'sauthentication attempt succeeded (checked by retrieving the private state saved by the login() and commit() methods), then this method cleans up any state that was originally saved.

Specified by:
abort in interface LoginModule
Returns:
false if the RADIUSLogin module's own login and/or commit attempts failed, and true otherwise.
Throws:
LoginException - if the abort fails.

logout

public boolean logout()
               throws LoginException
Logout the user. Removes the RADIUSPrincipal that was added by the commit() method.

Specified by:
logout in interface LoginModule
Returns:
true in all cases since the RADIUSLogin module should not be ignored.
Throws:
LoginException - if the logout fails.

RADIUS Client API (V3)

Submit a bug report or feature request

Copyright 1998-2008 AXL Software. PO Box 97, Viola, Delaware 19979, U.S.A. All Rights Reserved.