Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # from openid.extensions.ax import fromSuccessResponse
- def fromSuccessResponse(cls, success_response, signed=True):
- """Construct a FetchResponse object from an OpenID library
- SuccessResponse object.
- @param success_response: A successful id_res response object
- @type success_response: openid.consumer.consumer.SuccessResponse
- @param signed: Whether non-signed args should be
- processsed. If True (the default), only signed arguments
- will be processsed.
- @type signed: bool
- @returns: A FetchResponse containing the data from the OpenID
- message, or None if the SuccessResponse did not contain AX
- extension data.
- @raises AXError: when the AX data cannot be parsed.
- """
- self = cls()
- ax_args = success_response.extensionResponse(self.ns_uri, signed)
- try:
- self.parseExtensionArgs(ax_args)
- except NotAXMessage, err:
- return None
- else:
- return self
- fromSuccessResponse = classmethod(fromSuccessResponse)
Add Comment
Please, Sign In to add comment