Commits

Martin von Löwis  committed f7ce79e

Drop usage of cookies.

  • Participants
  • Parent commits 1a65621

Comments (0)

Files changed (1)

File openid2rp/testapp.py

 #!/usr/bin/env python
 ################ Test Server #################################
-import BaseHTTPServer, cgi, Cookie, socket, collections
+import BaseHTTPServer, cgi, socket, collections
 from openid2rp import *
 from time import time
 
                                  (services, url, session['assoc_handle'],
                                   self.base_url+"?returned=1",
                                   claimed, op_local))
-
-                # 1.1 compatibility: openid.claimed_id" is not defined by
-                # OpenID Authentication 1.1.  RPs MAY send the value when
-                # making requests, but MUST NOT depend on the value being
-                # present in authentication responses.  When the OP-Local
-                # Identifier ("openid.identity") is different from the Claimed
-                # Identifier, the RP MUST keep track of what Claimed Identifier
-                # was used to discover the OP-Local Identifier, for example by
-                # keeping it in session state.  Although the Claimed Identifier
-                # will not be present in the response, it MUST be used as the
-                # identifier for the user
-                self.send_header('Set-Cookie', 'openid.claimed_id='+claimed)
-
                 self.end_headers()
                 return                
             if 'returned' in query:
                 try:
                     claimed_id, = query['openid.claimed_id']
                 except KeyError:
-                    no_fragment = claimed_id = Cookie.SimpleCookie(self.headers['Cookie'])['openid.claimed_id'].value
-                else:
-
-                    # If the Claimed Identifier in the assertion is a URL and
-                    # contains a fragment, the fragment part and the fragment
-                    # delimiter character "#" MUST NOT be used for the purposes
-                    # of verifying the discovered information
-                    try:
-                        no_fragment = claimed_id[:claimed_id.index('#')]
-                    except ValueError:
-                        no_fragment = claimed_id
+                    # The library put in the openid1 field. 
+                    # XXX need to introduce library function to extract claimed ID
+                    claimed_id, = query['openid1']
+                # If the Claimed Identifier in the assertion is a URL and
+                # contains a fragment, the fragment part and the fragment
+                # delimiter character "#" MUST NOT be used for the purposes
+                # of verifying the discovered information
+                try:
+                    no_fragment = claimed_id[:claimed_id.index('#')]
+                except ValueError:
+                    no_fragment = claimed_id
 
                 # If the Claimed Identifier is included in the assertion, it
                 # MUST have been discovered by the RP and the information in