ccc.security
Class CCCLoginModule

java.lang.Object
  extended by ccc.security.CCCLoginModule
All Implemented Interfaces:
javax.security.auth.spi.LoginModule

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

A JAAS login module for authenticating CCC users.

Author:
Civic Computing Ltd.

Constructor Summary
CCCLoginModule()
          Constructor.
CCCLoginModule(Database db)
          Constructor.
 
Method Summary
 boolean abort()
          
 boolean commit()
          
 java.security.acl.Group createCallerPrincipal(java.lang.String name)
          Create a JAAS principal representing the user.
 java.security.acl.Group createPerms(java.util.Collection<java.lang.String> perms)
          Create a JAAS group representing a user's permissions.
 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)
          
 boolean login()
          
 boolean logout()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CCCLoginModule

public CCCLoginModule()
Constructor.


CCCLoginModule

public CCCLoginModule(Database db)
Constructor.

Parameters:
db - The database to search for users.
Method Detail

abort

public boolean abort()

Specified by:
abort in interface javax.security.auth.spi.LoginModule

commit

public boolean commit()

Specified by:
commit in interface javax.security.auth.spi.LoginModule

initialize

public 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)

Specified by:
initialize in interface javax.security.auth.spi.LoginModule

login

public boolean login()
              throws javax.security.auth.login.LoginException

Specified by:
login in interface javax.security.auth.spi.LoginModule
Throws:
javax.security.auth.login.LoginException

logout

public boolean logout()

Specified by:
logout in interface javax.security.auth.spi.LoginModule

createPerms

public java.security.acl.Group createPerms(java.util.Collection<java.lang.String> perms)
Create a JAAS group representing a user's permissions.

Parameters:
perms - The permissions represented as strings.
Returns:
The permissions represented as a JAAS group.

createCallerPrincipal

public java.security.acl.Group createCallerPrincipal(java.lang.String name)
Create a JAAS principal representing the user.

Parameters:
name - The name for the principal.
Returns:
The JAAS principal.


Copyright © 2010. All Rights Reserved.