Login | Register
Login | Register

My pages Projects SunSource.net openCollabNet

com.sun.grid.grm.security.role
Class RoleLoginModule

java.lang.Object
  extended by com.sun.grid.grm.security.role.RoleLoginModule
All Implemented Interfaces:
javax.security.auth.spi.LoginModule

public class RoleLoginModule
extends java.lang.Object
implements javax.security.auth.spi.LoginModule

The RoleLoginModule searches the roles of the currents subject principals and adds the corresponding RolePrincipal to the current subject.

This LoginModule does not need any configuration. The connection parameter to Hedeby Configuration Service is taken from the system properties. This means that this LoginModule can only be used inside a Hedeby Child JVM.

Example JAAS config

   sample {
      com.sun.security.auth.module.UnixLoginModule required;

      com.sun.grid.grm.security.role.RoleLoginModule optional;
                                                     
   };
  


Constructor Summary
RoleLoginModule()
           
 
Method Summary
 boolean abort()
          Method to abort the authentication process (phase 2).
 boolean commit()
          Method to commit the authentication process (phase 2).
 void initialize(javax.security.auth.Subject subject, javax.security.auth.callback.CallbackHandler callbackHandler, java.util.Map<java.lang.String,?> sharedState, java.util.Map<java.lang.String,?> options)
          initialize the LoginModule.
 boolean login()
          Method to authenticate a Subject (phase 1).
 boolean logout()
          Method which logs out a Subject.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoleLoginModule

public RoleLoginModule()
Method Detail

initialize

public final void initialize(javax.security.auth.Subject subject,
                             javax.security.auth.callback.CallbackHandler callbackHandler,
                             java.util.Map<java.lang.String,?> sharedState,
                             java.util.Map<java.lang.String,?> options)
                      throws java.lang.IllegalArgumentException
initialize the LoginModule.

Specified by:
initialize in interface javax.security.auth.spi.LoginModule
Parameters:
subject - the current subject
callbackHandler - the callback handler
sharedState - map for storing shared states
options - options for the LoginModules
Throws:
java.lang.IllegalArgumentException - if the role file can not be read

login

public final boolean login()
Method to authenticate a Subject (phase 1).

Specified by:
login in interface javax.security.auth.spi.LoginModule
Returns:
true if the prinicipals of the current subject matches to at least one role.

commit

public final boolean commit()
                     throws javax.security.auth.login.LoginException
Method to commit the authentication process (phase 2). This method adds the RolePrincipals to the current subject.

Specified by:
commit in interface javax.security.auth.spi.LoginModule
Returns:
true if this method succeeded, or false if this LoginModule should be ignored.
Throws:
javax.security.auth.login.LoginException - if the commit fails

abort

public final boolean abort()
                    throws javax.security.auth.login.LoginException
Method to abort the authentication process (phase 2).

Specified by:
abort in interface javax.security.auth.spi.LoginModule
Returns:
true if this method succeeded, or false if this LoginModule should be ignored.
Throws:
javax.security.auth.login.LoginException - if the abort fails

logout

public final boolean logout()
                     throws javax.security.auth.login.LoginException
Method which logs out a Subject.

Specified by:
logout in interface javax.security.auth.spi.LoginModule
Returns:
true if this method succeeded, or false if this LoginModule should be ignored.
Throws:
javax.security.auth.login.LoginException - if the logout fails


The Contents of this document are made available subject to the terms of the Sun Industry Standards Source License Version 1.2 (see Sun Industry Standards Source License Version 1.2).