Quantcast
Channel: Amit Yadav » Openid
Viewing all articles
Browse latest Browse all 2

openid.sreg

$
0
0

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.

  1. The relying party creates a request object and adds it to the
    <a class="link" href="http://openidenabled.com/files/python-openid/docs/1.2.0/openid.consumer.consumer.AuthRequest-class.html"><code>AuthRequest
    object before making the
    checkid_
    request to the OpenID provider:
    auth_request.addExtension(SRegRequest(required=['email']))
  2. The OpenID provider extracts the simple registration request from the OpenID request using
    SRegRequest.fromOpenIDRequest
    , gets the user’s approval and data, creates a
    <a class="link" href="http://openidenabled.com/files/python-openid/docs/1.2.0/openid.sreg.SRegResponse-class.html"><code>SRegResponse
    object and adds it to the
    id_res
    response:
    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)
  3. The relying party uses
    SRegResponse.fromSuccessResponse
    to extract the data from the OpenID response:
    sreg_resp = SRegResponse.fromSuccessResponse(success_response)

Share


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images