diff --git a/portail_citoyen2/allauth_authentic2/app_settings.py b/portail_citoyen2/allauth_authentic2/app_settings.py index 6ebbc07..adaf514 100644 --- a/portail_citoyen2/allauth_authentic2/app_settings.py +++ b/portail_citoyen2/allauth_authentic2/app_settings.py @@ -3,6 +3,7 @@ import sys class AppSettings(object): __defaults = { 'ADMIN_ROLE': None, + 'VERIFY': True, } def __init__(self, prefix): diff --git a/portail_citoyen2/allauth_authentic2/views.py b/portail_citoyen2/allauth_authentic2/views.py index d5de16a..0d177d1 100644 --- a/portail_citoyen2/allauth_authentic2/views.py +++ b/portail_citoyen2/allauth_authentic2/views.py @@ -8,6 +8,7 @@ from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, OAuth2LoginView, OAuth2CallbackView) from .provider import Authentic2Provider +from . import app_settings log = logging.getLogger(__name__) @@ -35,7 +36,8 @@ class Authentic2OAuth2Adapter(OAuth2Adapter): def complete_login(self, request, app, token, **kwargs): resp = requests.get(self.profile_url, - headers={'authorization': 'Bearer %s' % token.token}) + headers={'authorization': 'Bearer %s' % token.token}, + verify=app_settings.VERIFY) extra_data = resp.json() log.debug('received profile data: %r', extra_data) return self.get_provider().sociallogin_from_response(request,