net.sourceforge.heracles.service.impl
Class AuthenticationImpl

java.lang.Object
  extended by net.sourceforge.heracles.service.impl.AuthenticationImpl
All Implemented Interfaces:
Authentication

public class AuthenticationImpl
extends java.lang.Object
implements Authentication

Title: AuthenticationImpl.java
Description: The implementation of the Serivce Interface
Java Version: JDK 1.5

Author:
Philipp Gantert version 1.0

Field Summary
private  KerberosQuery kerberosQuery
           
private  org.apache.log4j.Logger logger
           
private  Search search
           
 
Constructor Summary
AuthenticationImpl()
           
 
Method Summary
 LdapUser authAdvanced(java.lang.String username, java.lang.String password)
          This method receives from the API implementation the username and password.
 void authSimple(java.lang.String username, java.lang.String password)
          This methodes receivse from the API implementation the username and password.
private  java.util.List<java.security.Principal> findPrincipals(javax.security.auth.Subject kerberosSubject)
          This is a helper method to get the principals from the kerberosSubject.
 void setKerberosQuery(KerberosQuery kerberosQuery)
          This method is for spring to set a KerberosQuery object
 void setSearch(Search search)
          This method is for spring to set a Search object
private  java.lang.String splitDomainName(java.lang.String username)
          This methode splits the username from the domainname and gets the domainname
private  java.lang.String splitUserName(java.lang.String username)
          This methode splits the username from the domainname and gets the username
private  void validating(java.lang.String username, java.lang.String password)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private org.apache.log4j.Logger logger

kerberosQuery

private KerberosQuery kerberosQuery

search

private Search search
Constructor Detail

AuthenticationImpl

public AuthenticationImpl()
Method Detail

setSearch

public void setSearch(Search search)
This method is for spring to set a Search object

Parameters:
search - Search: set method for spring

setKerberosQuery

public void setKerberosQuery(KerberosQuery kerberosQuery)
This method is for spring to set a KerberosQuery object

Parameters:
kerberosQuery - KerberosQuery: set method for spring

authAdvanced

public LdapUser authAdvanced(java.lang.String username,
                             java.lang.String password)
                      throws javax.security.auth.login.LoginException,
                             javax.naming.NamingException,
                             HeraclesException
This method receives from the API implementation the username and password. At first these values will be submited to the Kerberos query. As result it receives a kerberosSubject Objekt. To find the right LDAP User we must extract all Principals from the kerberosSubjact. After that we can query the ldap and we receive the right ldapUser object.

Specified by:
authAdvanced in interface Authentication
Parameters:
username - String: users username
password - String: password of the user
Returns:
LdapUser
Throws:
javax.security.auth.login.LoginException
javax.naming.NamingException
HeraclesException

authSimple

public void authSimple(java.lang.String username,
                       java.lang.String password)
                throws javax.security.auth.login.LoginException,
                       HeraclesException
This methodes receivse from the API implementation the username and password. These values will be submited to the Kerberos query.

Specified by:
authSimple in interface Authentication
Parameters:
username - String: users username
password - String: password of the user
Throws:
javax.security.auth.login.LoginException
HeraclesException

findPrincipals

private java.util.List<java.security.Principal> findPrincipals(javax.security.auth.Subject kerberosSubject)
This is a helper method to get the principals from the kerberosSubject.

Parameters:
kerberosSubject - Subject: Subject from JAAS
Returns:
List

splitDomainName

private java.lang.String splitDomainName(java.lang.String username)
This methode splits the username from the domainname and gets the domainname

Parameters:
username - String: users username
Returns:
String

splitUserName

private java.lang.String splitUserName(java.lang.String username)
This methode splits the username from the domainname and gets the username

Parameters:
username - String: users username
Returns:
String

validating

private void validating(java.lang.String username,
                        java.lang.String password)
                 throws HeraclesException
Parameters:
username - String: users username
password - String: password of the user
Throws:
HeraclesException


Copyright © 2007 null. All Rights Reserved.