org.aselect.server.authspprotocol.handler
Class Ldap

java.lang.Object
  extended by org.aselect.server.authspprotocol.handler.Ldap
All Implemented Interfaces:
IAuthSPDirectLoginProtocolHandler, IAuthSPProtocolHandler

public class Ldap
extends java.lang.Object
implements IAuthSPProtocolHandler, IAuthSPDirectLoginProtocolHandler

The Ldap AuthSP Handler.

Description:
The Ldap AuthSP Handler communicates with the Ldap AuthSP by redirecting the client.

Concurrency issues:
None

Protocol Description
Outgoing request going to the Ldap AuthSP:

name value
ridA-Select Server request id
as_urlA-Select Server url
uidA-Select Server user ID
a-select-serverA-Select Server ID
signature signature of all paramaters in the above sequence

Incoming response, which is returned by the Ldap AuthSP:
name value
ridA-Select Server request id
result_codeAuthSP result code
a-select-serverA-Select Server ID
signature Signature over the following data:
  1. rid
  2. The URL that was created in computeAuthenticationRequest()
  3. result_code
  4. a-select-server

Author:
Alfa & Ariss

Constructor Summary
Ldap()
           
 
Method Summary
 java.util.Hashtable computeAuthenticationRequest(java.lang.String sRid)
          Creates the authentication request URL.
 void handleDirectLoginRequest(java.util.Hashtable htServiceRequest, javax.servlet.http.HttpServletResponse servletResponse, java.io.PrintWriter pwOut, java.lang.String sServerId, javax.servlet.http.HttpServletRequest servletRequest)
          handles all the incoming direct login requests for the LDAP AuthSP

 void init(java.lang.Object oAuthSPConfig, java.lang.Object oAuthSPResource)
          Initializes the Ldap AuthSP handler.
 void init(java.lang.String sAuthSPId)
          new init function.
 java.util.Hashtable verifyAuthenticationResponse(java.util.Hashtable htAuthspResponse)
          Verifies the response from the AuthSP.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ldap

public Ldap()
Method Detail

init

public void init(java.lang.Object oAuthSPConfig,
                 java.lang.Object oAuthSPResource)
          throws ASelectAuthSPException
Initializes the Ldap AuthSP handler.

Description:
Performs the following steps:

Specified by:
init in interface IAuthSPProtocolHandler
Parameters:
oAuthSPConfig - Object containing the authsp specific configuration.
oAuthSPResource - Object containing the authsp specific resource(s).
Throws:
ASelectAuthSPException - If initialization fails.
See Also:
IAuthSPProtocolHandler.init(java.lang.Object, java.lang.Object)

init

public void init(java.lang.String sAuthSPId)
          throws ASelectAuthSPException
new init function.

Specified by:
init in interface IAuthSPDirectLoginProtocolHandler
Parameters:
sAuthSPId - String containing the AuthSP Id.
Throws:
ASelectAuthSPException - If initialization fails.
See Also:
IAuthSPDirectLoginProtocolHandler.init(java.lang.String)

computeAuthenticationRequest

public java.util.Hashtable computeAuthenticationRequest(java.lang.String sRid)
Creates the authentication request URL.

Description:
This method creates a hashtable with the follwing contents:
key value
result Errors.ERROR_ASELECT_SUCCESS or an error code if creating the authentication request URL fails
redirect_url The URL to the AuthSP including the protocol parameters as specified if the class description.

Specified by:
computeAuthenticationRequest in interface IAuthSPProtocolHandler
Parameters:
sRid - Needed parameter in the redirect URL. Can also be used to retrieve session information from the SessionManager.
Returns:
Hashtable containing at least:
  • result
  • redirect_url
See Also:
IAuthSPProtocolHandler.computeAuthenticationRequest(java.lang.String)

verifyAuthenticationResponse

public java.util.Hashtable verifyAuthenticationResponse(java.util.Hashtable htAuthspResponse)
Verifies the response from the AuthSP.

Description:
This method verifies the response from the AuthSP. The response parameters are placed in htAuthspResponse and are described in the class description.

This method creates a hashtable with the following contents:
key value
result Errors.ERROR_ASELECT_SUCCESS or an error code if the authentication response was invalid or the user was not authenticated.
rid The A-Select request identifier of this authentication.

Specified by:
verifyAuthenticationResponse in interface IAuthSPProtocolHandler
Parameters:
htAuthspResponse - Hashtable containing all parameters that were received from the AuthSP. It should contain at least:
  • rid
Returns:
Hashtable containing at least:
  • result
  • rid
See Also:
IAuthSPProtocolHandler.verifyAuthenticationResponse(java.util.Hashtable)

handleDirectLoginRequest

public void handleDirectLoginRequest(java.util.Hashtable htServiceRequest,
                                     javax.servlet.http.HttpServletResponse servletResponse,
                                     java.io.PrintWriter pwOut,
                                     java.lang.String sServerId,
                                     javax.servlet.http.HttpServletRequest servletRequest)
                              throws ASelectException
handles all the incoming direct login requests for the LDAP AuthSP

Specified by:
handleDirectLoginRequest in interface IAuthSPDirectLoginProtocolHandler
Throws:
ASelectException
See Also:
org.aselect.server.authspprotocol.IAuthSPDirectLoginProtocolHandler#handleDirectLoginRequest(java.util.Hashtable, javax.servlet.http.HttpServletResponse, java.io.PrintWriter, java.lang.String)


Copyright © 2008 SURFnet BV. All Rights Reserved.