openid.sreg
Category : General
Simple registration request and response parsing and object representation
This module contains objects representing simple registration requests and responses that can be used with both OpenID relying parties and OpenID providers.
- The relying party creates a request object and adds it to the
object before making theAuthRequestcheckid_request to the OpenID provider:auth_request.addExtension(SRegRequest(required=['email']))
- The OpenID provider extracts the simple registration request from the OpenID request using
, gets the user’s approval and data, creates aSRegRequest.fromOpenIDRequestobject and adds it to theSRegResponseid_resresponse:sreg_req = SRegRequest.fromOpenIDRequest(checkid_request.message) # [ get the user's approval and data, informing the user that # the fields in sreg_response were requested ] sreg_resp = SRegResponse.extractResponse(sreg_req, user_data) sreg_resp.toMessage(openid_response.fields)
- The relying party uses
to extract the data from the OpenID response:SRegResponse.fromSuccessResponsesreg_resp = SRegResponse.fromSuccessResponse(success_response)












