org.openid4java.message.pape
Class PapeRequest

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

public class PapeRequest
extends PapeMessage

Implements the extension for OpenID Provider Authentication Policy requests.

Author:
Marius Scurtescu, Johnny Bufu
See Also:
Message

Field Summary
protected static java.util.List PAPE_FIELDS
           
 
Fields inherited from class org.openid4java.message.pape.PapeMessage
_parameters, AUTH_LEVEL_NS_PREFIX, AUTH_LEVEL_PREFIX, authLevelAliases, OPENID_NS_PAPE, PAPE_POLICY_MULTI_FACTOR, PAPE_POLICY_MULTI_FACTOR_PHYSICAL, PAPE_POLICY_PHISHING_RESISTANT
 
Constructor Summary
protected PapeRequest()
          Constructs a Pape Request with an empty parameter list.
protected PapeRequest(ParameterList params)
          Constructs a PapeRequest from a parameter list.
 
Method Summary
 void addPreferredAuthPolicy(java.lang.String policyUri)
          Adds an authentication policy URI to the preferred_auth_policies parameter.
 void addPreferredCustomAuthLevel(java.lang.String authLevelTypeUri)
           
static PapeRequest createPapeRequest()
          Constructs a Pape Request with an empty parameter list.
static PapeRequest createPapeRequest(ParameterList params)
          Constructs a PapeRequest from a parameter list.
 int getMaxAuthAge()
          Gets the max_auth_age parameter.
 java.lang.String getPreferredAuthPolicies()
          Gets the preferred_auth_policies parameter value.
 java.util.List getPreferredAuthPoliciesList()
          Gets a list with the preferred_auth_policies.
 void setMaxAuthAge(int seconds)
          Sets the max_auth_age parameter.
 void setPreferredAuthPolicies(java.lang.String policyUris)
          Sets a new value for the preferred_auth_policies parameter.
 void validate()
          Checks the validity of the extension.
 
Methods inherited from class org.openid4java.message.pape.PapeMessage
addAuthLevelExtension, getCustomAuthLevelAlias, getExtension, getParameter, getParameters, getParameterValue, getTypeUri, hasCustomAuthLevel, hasParameter, providesIdentifier, set, setParameters, signRequired
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PAPE_FIELDS

protected static final java.util.List PAPE_FIELDS
Constructor Detail

PapeRequest

protected PapeRequest()
Constructs a Pape Request with an empty parameter list.


PapeRequest

protected PapeRequest(ParameterList params)
Constructs a PapeRequest from a parameter list.

The parameter list can be extracted from a received message with the getExtensionParams method of the Message class, and MUST NOT contain the "openid.." prefix.

Method Detail

createPapeRequest

public static PapeRequest createPapeRequest()
Constructs a Pape Request with an empty parameter list.


createPapeRequest

public static PapeRequest createPapeRequest(ParameterList params)
                                     throws MessageException
Constructs a PapeRequest from a parameter list.

The parameter list can be extracted from a received message with the getExtensionParams method of the Message class, and MUST NOT contain the "openid.." prefix.

Throws:
MessageException

getPreferredAuthPolicies

public java.lang.String getPreferredAuthPolicies()
Gets the preferred_auth_policies parameter value.


setPreferredAuthPolicies

public void setPreferredAuthPolicies(java.lang.String policyUris)
Sets a new value for the preferred_auth_policies parameter. The previous value of the parameter will be owerwritten.

Parameters:
policyUris - Space separated list of authentication policy URIs to be set.
See Also:
addPreferredAuthPolicy(String)

addPreferredAuthPolicy

public void addPreferredAuthPolicy(java.lang.String policyUri)
Adds an authentication policy URI to the preferred_auth_policies parameter.

Parameters:
policyUri - The authentication policy URI to be set.
See Also:
setPreferredAuthPolicies(String)

getPreferredAuthPoliciesList

public java.util.List getPreferredAuthPoliciesList()
Gets a list with the preferred_auth_policies. An empty list is returned if no authentication policies exist.


setMaxAuthAge

public void setMaxAuthAge(int seconds)
Sets the max_auth_age parameter.

Parameters:
seconds - The number of seconds within which the OP is requested to have actively authenticated the user.

getMaxAuthAge

public int getMaxAuthAge()
Gets the max_auth_age parameter.

Returns:
The number of seconds within which the OP is requested to have actively authenticated the user, or -1 if max_auth_age is not present in the request.

validate

public void validate()
              throws MessageException
Checks the validity of the extension.

Used when constructing a extension from a parameter list.

Throws:
MessageException - if the PapeRequest is not valid.

addPreferredCustomAuthLevel

public void addPreferredCustomAuthLevel(java.lang.String authLevelTypeUri)


Copyright © 2011 Sxip. All Rights Reserved.