Jannis Leidel avatar Jannis Leidel committed 6ee3f59

Added OPENID_PROVIDER_AX_EXTENSION setting to trigger AX extension support.

Comments (0)

Files changed (2)




 from django.contrib.auth import REDIRECT_FIELD_NAME
 from openid.consumer.discover import OPENID_IDP_2_0_TYPE, OPENID_2_0_TYPE
+from openid.extensions import sreg, ax
 from openid.fetchers import HTTPFetchingError
 from openid.server.server import Server
 from openid.server.trustroot import verifyReturnTo
         oresponse = server.handleRequest(orequest)
     if request.user.is_authenticated():
         add_sreg_data(request, orequest, oresponse)
-        add_ax_data(request, orequest, oresponse)
+        if conf.AX_EXTENSION:
+            add_ax_data(request, orequest, oresponse)
     # Convert a webresponse from the OpenID library in to a Django HttpResponse
     webresponse = server.encodeResponse(oresponse)
     if webresponse.code == 200:
     if identity:
         types = [OPENID_2_0_TYPE]
-        types = [OPENID_IDP_2_0_TYPE]
+        types = [OPENID_IDP_2_0_TYPE, sreg.ns_uri]
+        if conf.AX_EXTENSION:
+            types.append(ax.AXMessage.ns_uri)
     endpoints = [request.build_absolute_uri(reverse('openid-provider-root'))]
     return render_to_response('openid_provider/xrds.xml', {
         'host': request.build_absolute_uri('/'),
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.