Package openid :: Package extensions :: Package draft :: Module pape5 :: Class Request
[frames] | no frames]

Class Request

source code

         object --+        
                  |        
extension.Extension --+    
                      |    
          PAPEExtension --+
                          |
                         Request

A Provider Authentication Policy request, sent from a relying party to a provider

Instance Methods
 
__init__(self, preferred_auth_policies=None, max_auth_age=None, preferred_auth_level_types=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__nonzero__(self) source code
 
addPolicyURI(self, policy_uri)
Add an acceptable authentication policy URI to this request
source code
 
addAuthLevel(self, auth_level_uri, alias=None) source code
 
getExtensionArgs(self)
Get the string arguments that should be added to an OpenID message for this extension.
source code
None
parseExtensionArgs(self, args, is_openid1, strict=False)
Set the state of this request to be that expressed in these PAPE arguments
source code
[str]
preferredTypes(self, supported_types)
Given a list of authentication policy URIs that a provider supports, this method returns the subsequence of those types that are preferred by the relying party.
source code

Inherited from extension.Extension: toMessage

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Methods
 
fromOpenIDRequest(cls, request)
Instantiate a Request object from the arguments in a checkid_* OpenID message
source code
Class Variables
  ns_alias = 'pape'
  ns_uri = 'http://specs.openid.net/extensions/pape/1.0'
The namespace to which to add the arguments for this extension
Instance Variables
int or NoneType max_auth_age
The maximum time, in seconds, that the relying party wants to allow to have elapsed before the user must re-authenticate
[str] preferred_auth_level_types
Ordered list of authentication level namespace URIs
[str] preferred_auth_policies
The authentication policies that the relying party prefers
Properties

Inherited from object: __class__

Method Details

__init__(self, preferred_auth_policies=None, max_auth_age=None, preferred_auth_level_types=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

addPolicyURI(self, policy_uri)

source code 

Add an acceptable authentication policy URI to this request

This method is intended to be used by the relying party to add acceptable authentication types to the request.

Parameters:
  • policy_uri - The identifier for the preferred type of authentication.

See Also: http://openid.net/specs/openid-provider-authentication-policy-extension-1_0-05.html#auth_policies

getExtensionArgs(self)

source code 

Get the string arguments that should be added to an OpenID message for this extension.

Returns:
A dictionary of completely non-namespaced arguments to be added. For example, if the extension's alias is 'uncle', and this method returns {'meat':'Hot Rats'}, the final message will contain {'openid.uncle.meat':'Hot Rats'}
Overrides: extension.Extension.getExtensionArgs

parseExtensionArgs(self, args, is_openid1, strict=False)

source code 

Set the state of this request to be that expressed in these PAPE arguments

Parameters:
  • args - The PAPE arguments without a namespace
  • strict - Whether to raise an exception if the input is out of spec or otherwise malformed. If strict is false, malformed input will be ignored.
  • is_openid1 - Whether the input should be treated as part of an OpenID1 request
Returns: None
Raises:
  • ValueError - When the max_auth_age is not parseable as an integer

preferredTypes(self, supported_types)

source code 

Given a list of authentication policy URIs that a provider supports, this method returns the subsequence of those types that are preferred by the relying party.

Parameters:
  • supported_types - A sequence of authentication policy type URIs that are supported by a provider
Returns: [str]
The sub-sequence of the supported types that are preferred by the relying party. This list will be ordered in the order that the types appear in the supported_types sequence, and may be empty if the provider does not prefer any of the supported authentication types.