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

Class Response

source code

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

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

Instance Methods
 
__init__(self, auth_policies=None, auth_time=None, auth_levels=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
setAuthLevel(self, level_uri, level, alias=None)
Set the value for the given auth level type.
source code
 
getAuthLevel(self, level_uri)
Return the auth level for the specified auth level identifier
source code
 
addPolicyURI(self, policy_uri)
Add a authentication policy to this response
source code
 
parseExtensionArgs(self, args, is_openid1, strict=False)
Parse the provider authentication policy arguments into the internal state of this object
source code
 
getExtensionArgs(self)
Get the string arguments that should be added to an OpenID message for this extension.
source code

Inherited from extension.Extension: toMessage

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

Class Methods
Response or None
fromSuccessResponse(cls, success_response)
Create a Response object from a successful OpenID library response (openid.consumer.consumer.SuccessResponse) response 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
  auth_policies
List of authentication policies conformed to by this OpenID assertion, represented as policy URIs
Properties
  nist_auth_level
Backward-compatibility accessor for the NIST auth level

Inherited from object: __class__

Method Details

__init__(self, auth_policies=None, auth_time=None, auth_levels=None)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

setAuthLevel(self, level_uri, level, alias=None)

source code 

Set the value for the given auth level type.

Parameters:
  • level - string representation of an authentication level valid for level_uri
  • alias - An optional namespace alias for the given auth level URI. May be omitted if the alias is not significant. The library will use a reasonable default for widely-used auth level types.

getAuthLevel(self, level_uri)

source code 

Return the auth level for the specified auth level identifier

Returns:
A string that should map to the auth levels defined for the auth level type
Raises:
  • KeyError - If the auth level type is not present in this message

addPolicyURI(self, policy_uri)

source code 

Add a authentication policy to this response

This method is intended to be used by the provider to add a policy that the provider conformed to when authenticating the user.

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

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

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

source code 

Parse the provider authentication policy arguments into the internal state of this object

Parameters:
  • args - unqualified provider authentication policy arguments
  • strict - Whether to raise an exception when bad data is encountered
Returns:
None. The data is parsed into the internal fields of this object.

fromSuccessResponse(cls, success_response)
Class Method

source code 

Create a Response object from a successful OpenID library response (openid.consumer.consumer.SuccessResponse) response message

Parameters:
Returns: Response or None
A provider authentication policy response from the data that was supplied with the id_res response or None if the provider sent no signed PAPE response arguments.

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

Property Details

nist_auth_level

Backward-compatibility accessor for the NIST auth level

Get Method:
_getNISTAuthLevel(self)