This is a small follow-up to 050d8f8def:
After using a custom Steam provider with the new redirect method, we discovered some missing exception handling that OpenIDLoginVew.perform_openid_auth handles. I've borrowed the exception handling code from the perform_openid_auth method.
No changelog entry should be required, as the commit issue that introduced this issue has not been released yet.
The exceptions we get without this change look like this:
Traceback (most recent call last):
File "django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "allauth/headless/internal/decorators.py", line 47, in _wrapper_view
return view_func(request, *args, **kwargs)
File "django/views/generic/base.py", line 105, in view
return self.dispatch(request, *args, **kwargs)
File "allauth/headless/base/views.py", line 27, in dispatch
return super().dispatch(request, *args, **kwargs)
File "allauth/headless/internal/restkit/views.py", line 17, in dispatch
return self.handle(request, *args, **kwargs)
File "allauth/headless/internal/restkit/views.py", line 25, in handle
return super().dispatch(request, *args, **kwargs)
File "django/views/generic/base.py", line 144, in dispatch
return handler(request, *args, **kwargs)
File "allauth/headless/socialaccount/views.py", line 68, in post
return provider.redirect(
File "<redacted>/providers/steam/provider.py", line <redacted>, in redirect
auth_request = client.begin(endpoint)
File "openid/consumer/consumer.py", line 351, in begin
service = disco.getNextService(self._discover)
File "openid/yadis/manager.py", line 106, in getNextService
yadis_url, services = discover(self.url)
File "openid/consumer/discover.py", line 467, in discover
return discoverURI(identifier)
File "openid/consumer/discover.py", line 458, in discoverURI
claimed_id, openid_services = discoverYadis(uri)
File "openid/consumer/discover.py", line 383, in discoverYadis
response = yadisDiscover(uri)
File "openid/yadis/discover.py", line 77, in discover
raise DiscoveryFailure(
DiscoveryFailure: HTTP Response status from identity URL host is not 200. Got status 502
Submitting Pull Requests
General
- Make sure you use semantic commit messages.
Examples:"fix(google): Fixed foobar bug","feat(accounts): Added foobar feature". - All Python code must formatted using Black, and clean from pep8 and isort issues.
- JavaScript code should adhere to StandardJS.
- If your changes are significant, please update
ChangeLog.rst. - If your change is substantial, feel free to add yourself to
AUTHORS.
Provider Specifics
In case you add a new provider:
- Make sure unit tests are available.
- Ensure your provider is tested by adding an entry over at
tests/projects/common/settings.py::INSTALLED_SOCIALACCOUNT_APPS. - Provide provider specific documentation at
docs/socialaccount/providers/<provider name>.rst. - Link to your provider specific documentation at
docs/insocialaccount/providers/index.rst. - Add an entry for your provider in the quickstart, over at
docs/installation/quickstart.rst::INSTALLED_APPS.