...
 
Commits (4)
......@@ -40,16 +40,17 @@ class ID4meProvider(Provider):
validate_url=returnurl,
app_type=app_type,
client_name=client_name,
preferred_client_id=client_id
preferred_client_id=client_id,
get_client_registration=getRegisteredClient,
save_client_registration=storeRegisteredClient,
requireencryption=False
)
clientreg[(app_type, client_id)] = client
return client
def get_rp_context(self, id4me):
ctx = self._client.get_rp_context(
id4me,
find_authority=getRegisteredClient,
save_authority=storeRegisteredClient)
id4me)
return ctx
def get_consent_url(self, ctx):
......
......@@ -58,6 +58,13 @@ def callback(request):
safesession = JSONSafeSession(request.session)
ctx = ID4meContext.from_json(safesession['id4me_ctx'])
try:
if 'code' not in request.GET:
return render_authentication_error(
request,
ID4meProvider.id,
error=AuthError.DENIED if 'error' in request.GET and request.GET['error'] == 'access_denied' else AuthError.UNKNOWN,
exception=Exception(request.GET['error_description']) if 'error_description' in request.GET else None )
response = provider.get_response(ctx, request.GET['code'])
login = providers.registry \
.by_id(ID4meProvider.id, request) \
......
......@@ -3,7 +3,7 @@
from setuptools import setup
setup(name='django-allauth-id4me',
version='0.0.7',
version='0.0.10',
description='Social provider for django-allauth - ID4me https://id4me.org',
long_description_content_type="text/markdown",
long_description=open('README.md').read(),
......@@ -34,7 +34,7 @@ setup(name='django-allauth-id4me',
package_data={'django-allauth-id4me': ['allauth_id4me/templates/id4me/*.html']},
include_package_data=True,
install_requires=[
'id4me-rp-client >= 0.0.9',
'id4me-rp-client >= 0.0.12',
'Django >= 1.11.16',
'django-allauth >= 0.38.0',
],
......