Peter Troeger  committed 12111ca

Do the Django settings handling right

  • Participants
  • Parent commits a31625a
  • Branches default

Comments (0)

Files changed (2)

File doc/django.rst

 * A Django ``User`` object. In this case, the OpenID claim was successfully authenticated, and the backend found a user in the database with this claim attached. The object as additional attributes:
 	* ``openid_claim``: The claim that was finally authenticated. Depending on the OpenID provider, this might or might not be the original method input. In a later call to ``linkOpenID``, use only this one.
-	* ``openid_ax``: A dictionary of received AX values.
+	* ``openid_ax``: A dictionary of received AX values. The ``django.contrib.auth.AX`` dictionary contains a list of standardized key names. Check the openid2rp documentation for more information.
 	* ``openid_sreg``: A dictionary of received SREG values.	
 * A Django ``AnonymousUser`` object. In this case, the claim could not be related to any user in the database, but the OpenID authentication was ok. The object has the same additional attributes as above. In this situation, you should normally proceed with some new user registration functionality. You can use the AX / SREG data to pre-fill some registration form. 

File openid2rp/django/

 # we need to accept some difference between provider time and our time, for nonce and session checking
 # Martin says: Use the Kerberos default
-	maxTimeShift=datetime.timedelta(minutes=int(settings.OPENID2RP_MAXTIMESHIFT))
-	maxLoginDelay=datetime.timedelta(minutes=int(settings.OPENID2RP_MAXLOGINDELAY))
+shiftVal = int(getattr(settings, 'OPENID2RP_MAXTIMESHIFT', '5'))
+delayVal = int(getattr(settings, 'OPENID2RP_MAXLOGINDELAY', '5'))
+# mirror the AX key name dict, so that the app does not need openid2rp at all
 AX = openid2rp.AX
 class IncorrectURIError(Exception):