com.ibm.commerce.payment.utils
Class WPMAuthenticationHelper

java.lang.Object
  |
  +--com.ibm.commerce.payment.utils.WPMAuthenticationHelper

public class WPMAuthenticationHelper
extends java.lang.Object

WebSphere Payment Manager Authentication Helper class.


Field Summary
static java.lang.String ERR_ACCESS_DENIED
           
static java.lang.String PARAM_NAME_AUTHNAME
           
static java.lang.String PARAM_NAME_AUTHSTRING
           
static java.lang.String PARAM_NAME_PASSWORD
           
 
Constructor Summary
WPMAuthenticationHelper()
          WPMAuthenticationHelper constructor comment.
 
Method Summary
static UserRegistryAccessBean getAuthenticatedUserRegistry(java.lang.String authString, java.lang.String name, java.lang.String password, CommandContext cmdCtx)
          Returns the UserRegistryAccessBean for the WebSphere Commerce Administrator if the supplied credentials for the Administrator (a Payment Manager User) is valid.
static java.lang.String getUserIdFromAuthString(java.lang.String authString)
          Gets the userId from the Authentication String.
static boolean isDNof(java.lang.String name, java.lang.String shortname)
          Checks if the specified name is the distinguished name of the supplied shortname.
static TypedProperty prepareEncodedResponseToPM(java.lang.String textResponse)
          Prepare a TypedProperty object for sending text response to Payment Manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERR_ACCESS_DENIED

public static final java.lang.String ERR_ACCESS_DENIED

PARAM_NAME_AUTHNAME

public static final java.lang.String PARAM_NAME_AUTHNAME

PARAM_NAME_AUTHSTRING

public static final java.lang.String PARAM_NAME_AUTHSTRING

PARAM_NAME_PASSWORD

public static final java.lang.String PARAM_NAME_PASSWORD
Constructor Detail

WPMAuthenticationHelper

public WPMAuthenticationHelper()
WPMAuthenticationHelper constructor comment.
Method Detail

getAuthenticatedUserRegistry

public static UserRegistryAccessBean getAuthenticatedUserRegistry(java.lang.String authString,
                                                                  java.lang.String name,
                                                                  java.lang.String password,
                                                                  CommandContext cmdCtx)
                                                           throws ECException
Returns the UserRegistryAccessBean for the WebSphere Commerce Administrator if the supplied credentials for the Administrator (a Payment Manager User) is valid. The supplied credentials could be either the WebSphere Commerce Authentication Cookie or the logon ID (name) and password of the Administrator.

The logon ID must be active as well.

Parameters:
authString - a String representing the WebSphere Commerce Authentication Cookie
name - the logon ID of the user.
password - the logon password of the user.
cmdCtx - the CommandContext.
Returns:
the UserRegistryAccessBean representing the WebSphere Commerce Administrator if the credentials is valid. Otherwise, returns a null.
Throws:
ECException -  

getUserIdFromAuthString

public static java.lang.String getUserIdFromAuthString(java.lang.String authString)
Gets the userId from the Authentication String.
Returns:
user ID in the form of a String.

isDNof

public static boolean isDNof(java.lang.String name,
                             java.lang.String shortname)
Checks if the specified name is the distinguished name of the supplied shortname.

For WebSphere Commerce the String form of the distinguished name lists the relative distinguished names in the order of increasing hierarchy with the root organization on the right.

Parameters:
name - String form of the distinguished name to be checked.
shortname - the short name to be checked.
Returns:
true if the supplied short name appears on the left-most part of the specified distinguished name delimited on its immediate left by an EQUAL ("=") character and on its immediate right by a COMMA (",").

prepareEncodedResponseToPM

public static TypedProperty prepareEncodedResponseToPM(java.lang.String textResponse)
Prepare a TypedProperty object for sending text response to Payment Manager. The Text will be converted to UTF8 bytes and urlEncode the resulting Byte String.
Parameters:
textResponse - java.lang.String - text to be returned
Returns:
com.ibm.commerce.datatype.TypedProperty