org.openid4java.message.pape
Class PapeMessage

java.lang.Object
  extended by org.openid4java.message.pape.PapeMessage
All Implemented Interfaces:
MessageExtension, MessageExtensionFactory
Direct Known Subclasses:
PapeRequest, PapeResponse

public class PapeMessage
extends java.lang.Object
implements MessageExtension, MessageExtensionFactory

Base class for the OpenID Provider Authentication Policy extension implementation.

Encapsulates:

Author:
Marius Scurtescu, Johnny Bufu
See Also:
MessageExtension

Field Summary
private static org.apache.commons.logging.Log _log
           
protected  ParameterList _parameters
          The OpenID Provider Authentication Policy extension-specific parameters.
private static java.lang.String AUTH_LEVEL_ALIAS_PREFIX
           
protected static java.lang.String AUTH_LEVEL_NS_PREFIX
           
protected static java.lang.String AUTH_LEVEL_PREFIX
           
private  int authLevelAliasCounter
           
protected  java.util.Map authLevelAliases
           
private static boolean DEBUG
           
static java.lang.String OPENID_NS_PAPE
          The OpenID Provider Authentication Policy extension URI.
static java.lang.String PAPE_POLICY_MULTI_FACTOR
           
static java.lang.String PAPE_POLICY_MULTI_FACTOR_PHYSICAL
           
static java.lang.String PAPE_POLICY_PHISHING_RESISTANT
           
 
Constructor Summary
PapeMessage()
          Constructs an empty (no parameters) OpenID Provider Authentication Policy extension.
PapeMessage(ParameterList params)
          Constructs an OpenID Provider Authentication Policy extension with a specified list of parameters.
 
Method Summary
protected  java.lang.String addAuthLevelExtension(java.lang.String authLevelTypeUri)
           
private  java.lang.String addAuthLevelExtension(java.lang.String authLevelTypeUri, java.lang.String alias)
           
private  void checkAddAuthLevelExtension(Parameter param)
           
protected  java.lang.String getCustomAuthLevelAlias(java.lang.String authLevelTypeUri)
           
 MessageExtension getExtension(ParameterList parameterList, boolean isRequest)
          Instantiates the apropriate OpenID Provider Authentication Policy extension object (request / response) for the supplied parameter list.
protected  Parameter getParameter(java.lang.String name)
          Gets a the value of the parameter with the specified name.
 ParameterList getParameters()
          Gets ParameterList containing the OpenID Provider Authentication Policy extension-specific parameters.
 java.lang.String getParameterValue(java.lang.String name)
          Gets a the value of the parameter with the specified name.
 java.lang.String getTypeUri()
          Gets the Type URI that identifies the OpenID Provider Authentication Policy extension.
 boolean hasCustomAuthLevel(java.lang.String authLevelTypeUri)
           
 boolean hasParameter(java.lang.String name)
          Checks if the extension contains a parameter.
private  java.lang.String newAuthLevelAlias()
           
 boolean providesIdentifier()
          OpenID Provider Authentication Policy extension doesn't implement authentication services.
protected  void set(java.lang.String name, java.lang.String value)
          Sets the value for the parameter with the specified name.
 void setParameters(ParameterList params)
          Sets the extension's parameters to the supplied list.
 boolean signRequired()
          PAPE parameters are REQUIRED to be signed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_log

private static org.apache.commons.logging.Log _log

DEBUG

private static final boolean DEBUG

PAPE_POLICY_PHISHING_RESISTANT

public static final java.lang.String PAPE_POLICY_PHISHING_RESISTANT
See Also:
Constant Field Values

PAPE_POLICY_MULTI_FACTOR

public static final java.lang.String PAPE_POLICY_MULTI_FACTOR
See Also:
Constant Field Values

PAPE_POLICY_MULTI_FACTOR_PHYSICAL

public static final java.lang.String PAPE_POLICY_MULTI_FACTOR_PHYSICAL
See Also:
Constant Field Values

AUTH_LEVEL_PREFIX

protected static final java.lang.String AUTH_LEVEL_PREFIX
See Also:
Constant Field Values

AUTH_LEVEL_NS_PREFIX

protected static final java.lang.String AUTH_LEVEL_NS_PREFIX
See Also:
Constant Field Values

AUTH_LEVEL_ALIAS_PREFIX

private static final java.lang.String AUTH_LEVEL_ALIAS_PREFIX
See Also:
Constant Field Values

authLevelAliases

protected java.util.Map authLevelAliases

authLevelAliasCounter

private int authLevelAliasCounter

OPENID_NS_PAPE

public static final java.lang.String OPENID_NS_PAPE
The OpenID Provider Authentication Policy extension URI.

See Also:
Constant Field Values

_parameters

protected ParameterList _parameters
The OpenID Provider Authentication Policy extension-specific parameters.

The openid. prefix is not part of the parameter names

Constructor Detail

PapeMessage

public PapeMessage()
Constructs an empty (no parameters) OpenID Provider Authentication Policy extension.


PapeMessage

public PapeMessage(ParameterList params)
Constructs an OpenID Provider Authentication Policy extension with a specified list of parameters.

The parameter names in the list should not contain the openid..

Method Detail

getTypeUri

public java.lang.String getTypeUri()
Gets the Type URI that identifies the OpenID Provider Authentication Policy extension.

Specified by:
getTypeUri in interface MessageExtension
Specified by:
getTypeUri in interface MessageExtensionFactory

getParameters

public ParameterList getParameters()
Gets ParameterList containing the OpenID Provider Authentication Policy extension-specific parameters.

The openid. prefix is not part of the parameter names, as it is handled internally by the Message class.

The openid.ns. parameter is also handled by the Message class.

Specified by:
getParameters in interface MessageExtension
See Also:
Message

setParameters

public void setParameters(ParameterList params)
Sets the extension's parameters to the supplied list.

The parameter names in the list should not contain the openid. prefix.

Specified by:
setParameters in interface MessageExtension
See Also:
Message

hasParameter

public boolean hasParameter(java.lang.String name)
Checks if the extension contains a parameter.

Parameters:
name - The name of the parameter, without the openid. prefix.
Returns:
True if a parameter with the specified name exists, false otherwise.

set

protected void set(java.lang.String name,
                   java.lang.String value)
Sets the value for the parameter with the specified name.

Parameters:
name - The name of the parameter, without the openid. prefix.

checkAddAuthLevelExtension

private void checkAddAuthLevelExtension(Parameter param)

newAuthLevelAlias

private java.lang.String newAuthLevelAlias()

addAuthLevelExtension

protected java.lang.String addAuthLevelExtension(java.lang.String authLevelTypeUri)

addAuthLevelExtension

private java.lang.String addAuthLevelExtension(java.lang.String authLevelTypeUri,
                                               java.lang.String alias)

hasCustomAuthLevel

public boolean hasCustomAuthLevel(java.lang.String authLevelTypeUri)

getCustomAuthLevelAlias

protected java.lang.String getCustomAuthLevelAlias(java.lang.String authLevelTypeUri)

getParameter

protected Parameter getParameter(java.lang.String name)
Gets a the value of the parameter with the specified name.

Parameters:
name - The name of the parameter, without the openid. prefix.
Returns:
The parameter value, or null if not found.

getParameterValue

public java.lang.String getParameterValue(java.lang.String name)
Gets a the value of the parameter with the specified name.

Parameters:
name - The name of the parameter, without the openid. prefix.
Returns:
The parameter value, or null if not found.

providesIdentifier

public boolean providesIdentifier()
OpenID Provider Authentication Policy extension doesn't implement authentication services.

Specified by:
providesIdentifier in interface MessageExtension
Returns:
false

signRequired

public boolean signRequired()
PAPE parameters are REQUIRED to be signed.

Specified by:
signRequired in interface MessageExtension
Returns:

getExtension

public MessageExtension getExtension(ParameterList parameterList,
                                     boolean isRequest)
                              throws MessageException
Instantiates the apropriate OpenID Provider Authentication Policy extension object (request / response) for the supplied parameter list.

Specified by:
getExtension in interface MessageExtensionFactory
Parameters:
parameterList - The OpenID Provider Authentication Policy extension specific parameters (without the openid. prefix) extracted from the openid message.
isRequest - Indicates whether the parameters were extracted from an OpenID request (true), or from an OpenID response.
Returns:
MessageExtension implementation for the supplied extension parameters.
Throws:
MessageException - If a OpenID Provider Authentication Policy extension object could not be instantiated from the supplied parameter list.


Copyright 2006-2008 Sxip Identity Corporation