omab/django-social-auth — pull request #508 by scheeser (2012-11-01 16:01:11+00:00)
Title: Add support for additional PAPE settings on OpenID request

The initial pull request (https://github.com/omab/django-social-auth/pull/469) to add the Provider Authentication Policy Extension (PAPE) to the library only supported the max_auth_age parameter on the OpenID request. There are additional parameters on the request (https://github.com/openid/python-openid/blob/master/openid/extensions/draft/pape5.py#L113) that should also be supported as well.

This pull request will attempt to pull each of the three parameters from settings. If any one of them is present the extension will be added onto the OpenID request. This should be passive to any current consumers that only use the max_auth_age as None is the default input for the other two parameters. Looking at the spec http://openid.net/specs/openid-provider-authentication-policy-extension-1_0.html#anchor8 it seems all these parameters that are supported are optional except preferred_auth_policies which does accept zero entries which the python_openid library will handle by passing [] for that setting if it's None.