Guest User

Untitled

a guest
Apr 23rd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. # from openid.extensions.ax import fromSuccessResponse
  2.  
  3. def fromSuccessResponse(cls, success_response, signed=True):
  4. """Construct a FetchResponse object from an OpenID library
  5. SuccessResponse object.
  6.  
  7. @param success_response: A successful id_res response object
  8. @type success_response: openid.consumer.consumer.SuccessResponse
  9.  
  10. @param signed: Whether non-signed args should be
  11. processsed. If True (the default), only signed arguments
  12. will be processsed.
  13. @type signed: bool
  14.  
  15. @returns: A FetchResponse containing the data from the OpenID
  16. message, or None if the SuccessResponse did not contain AX
  17. extension data.
  18.  
  19. @raises AXError: when the AX data cannot be parsed.
  20. """
  21. self = cls()
  22. ax_args = success_response.extensionResponse(self.ns_uri, signed)
  23. try:
  24. self.parseExtensionArgs(ax_args)
  25. except NotAXMessage, err:
  26. return None
  27. else:
  28. return self
  29.  
  30. fromSuccessResponse = classmethod(fromSuccessResponse)
Add Comment
Please, Sign In to add comment