django-auth-adfs 1.11.4__py3-none-any.whl → 1.11.5__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,4 +4,4 @@ This file is imported by setup.py
4
4
  Adding imports here will break setup.py
5
5
  """
6
6
 
7
- __version__ = '1.11.4'
7
+ __version__ = '1.11.5'
@@ -78,6 +78,7 @@ class Settings(object):
78
78
  self.PROXIES = None
79
79
 
80
80
  self.VERSION = 'v1.0'
81
+ self.SCOPES = []
81
82
 
82
83
  required_settings = [
83
84
  "AUDIENCE",
@@ -138,6 +139,10 @@ class Settings(object):
138
139
  elif "VERSION" in _settings:
139
140
  raise ImproperlyConfigured("The VERSION cannot be set when TENANT_ID is not set.")
140
141
 
142
+ if self.VERSION == "v2.0" and not self.SCOPES and self.RELYING_PARTY_ID:
143
+ warnings.warn('Use `SCOPES` for AzureAD instead of RELYING_PARTY_ID', DeprecationWarning)
144
+ if not isinstance(self.SCOPES, list):
145
+ raise ImproperlyConfigured("Scopes must be a list")
141
146
  # Overwrite defaults with user settings
142
147
  for setting, value in _settings.items():
143
148
  if hasattr(self, setting):
@@ -346,7 +351,10 @@ class ProviderConfig(object):
346
351
  })
347
352
  if self._mode == "openid_connect":
348
353
  if settings.VERSION == 'v2.0':
349
- query["scope"] = f"openid api://{settings.RELYING_PARTY_ID}/.default"
354
+ if settings.SCOPES:
355
+ query['scope'] = " ".join(settings.SCOPES)
356
+ else:
357
+ query["scope"] = f"openid api://{settings.RELYING_PARTY_ID}/.default"
350
358
  query.pop("resource")
351
359
  else:
352
360
  query["scope"] = "openid"
@@ -11,4 +11,5 @@ app_name = "rest_framework"
11
11
 
12
12
  urlpatterns = [
13
13
  re_path(r'^login$', views.OAuth2LoginView.as_view(), name='login'),
14
+ re_path(r'^logout$', views.OAuth2LogoutView.as_view(), name='logout'),
14
15
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-auth-adfs
3
- Version: 1.11.4
3
+ Version: 1.11.5
4
4
  Summary: A Django authentication backend for Microsoft ADFS and AzureAD
5
5
  Home-page: https://github.com/snok/django-auth-adfs
6
6
  License: BSD
@@ -1,8 +1,8 @@
1
- django_auth_adfs/__init__.py,sha256=euevnAm-cPW84ZlsJMIDQohV5CMe2SxqHrr9A6Rol7s,137
1
+ django_auth_adfs/__init__.py,sha256=vvinReQ530z7PGktsPFHHJ9Uup-RPzrI9rMkeD_oFeQ,137
2
2
  django_auth_adfs/backend.py,sha256=UxKnlMrQ3IMOnIiBd3itYtFOer-QxLTSHXXt5deew-s,18055
3
- django_auth_adfs/config.py,sha256=nC3H2iJVjgzmsZrqoWf83FEM9aSdaMbkXsG7lXtINrk,15808
3
+ django_auth_adfs/config.py,sha256=p9uNhl4C6OIuiUHAdYmW6LiqhvoI_ZnR_W-mh-u3Z6w,16251
4
4
  django_auth_adfs/drf-urls.py,sha256=bBnN1WrgbHoiAs5hTGe-ovmVwwJ4D2xXpYtZVfE8l5U,221
5
- django_auth_adfs/drf_urls.py,sha256=NcRbLVckCNWOXyTyTofwR7nDz7B_zNOwHAljFAI8KEw,355
5
+ django_auth_adfs/drf_urls.py,sha256=YKH7he1cCDr_eo0kgPJQiJ3kmo1FBS46JzSiBOOqwE0,430
6
6
  django_auth_adfs/exceptions.py,sha256=yxwKHtDSMnskgBdIQoCWerYVr8sGtIn26GWVVdhA2YU,110
7
7
  django_auth_adfs/middleware.py,sha256=st8Hx5pHWNcYUNWrCQht3QJqjw6RLQhWyxneTWal0Nw,2249
8
8
  django_auth_adfs/rest_framework.py,sha256=spWIXpb8UtVDvZ0_W_sJB-5u0hwvLNUCqbAhHf9N0W4,1656
@@ -10,7 +10,7 @@ django_auth_adfs/signals.py,sha256=HGD79-dZNEwqVuINoqe6jB_8K1RfuK5Q288RGamTtEU,1
10
10
  django_auth_adfs/templates/django_auth_adfs/login_failed.html,sha256=1NQ5aCjo7iTLSxy2IXJZbzBp5MaxpfsfQwQ_PDFvgr4,652
11
11
  django_auth_adfs/urls.py,sha256=4Cec5XbxrAqPHc_N3yMTC_m9UKZXsZktf3rO2niF4Bw,533
12
12
  django_auth_adfs/views.py,sha256=kwMqcsDAgcuQRBgxpRVnFZY79ZkVo28LB3KOIbayI3E,4100
13
- django_auth_adfs-1.11.4.dist-info/METADATA,sha256=Y-xXMi4yddLMe3EWv6Ss8-jz3o2mM3Ra4_xNPtFkMnw,6305
14
- django_auth_adfs-1.11.4.dist-info/WHEEL,sha256=vVCvjcmxuUltf8cYhJ0sJMRDLr1XsPuxEId8YDzbyCY,88
15
- django_auth_adfs-1.11.4.dist-info/LICENSE,sha256=n3ImkhGUnnJEu1sT51QKc_N22WdixSRcrfg9gj6nr3c,1296
16
- django_auth_adfs-1.11.4.dist-info/RECORD,,
13
+ django_auth_adfs-1.11.5.dist-info/LICENSE,sha256=n3ImkhGUnnJEu1sT51QKc_N22WdixSRcrfg9gj6nr3c,1296
14
+ django_auth_adfs-1.11.5.dist-info/METADATA,sha256=L2CsKBB8f2QYng6FvTiKDVrwIOYwT5Je1s4cOcv3baw,6305
15
+ django_auth_adfs-1.11.5.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
16
+ django_auth_adfs-1.11.5.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.4.0
2
+ Generator: poetry-core 1.5.2
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any