diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a11653a..34f082a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,14 @@ Changelog ========= +`1.8.1`_ - 2021-08-27 +--------------------- + +**Features** + +* Fix broken ``BLOCK_GUEST_USERS`` setting. @JonasKs #180 + + `1.8.0`_ - 2021-08-14 --------------------- @@ -253,6 +261,7 @@ Changelog * Initial release +.. _1.8.1: https://github.com/snok/django-auth-adfs/compare/1.8.0...1.8.1 .. _1.8.0: https://github.com/snok/django-auth-adfs/compare/1.7.0...1.8.0 .. _1.7.0: https://github.com/snok/django-auth-adfs/compare/1.6.1...1.7.0 .. _1.6.1: https://github.com/snok/django-auth-adfs/compare/1.6.0...1.6.1 diff --git a/django_auth_adfs/__init__.py b/django_auth_adfs/__init__.py index 9320862..549c3a4 100644 --- a/django_auth_adfs/__init__.py +++ b/django_auth_adfs/__init__.py @@ -4,4 +4,4 @@ Adding imports here will break setup.py """ -__version__ = '1.8.0' +__version__ = '1.8.1' diff --git a/django_auth_adfs/backend.py b/django_auth_adfs/backend.py index 98093f5..d5ff8db 100644 --- a/django_auth_adfs/backend.py +++ b/django_auth_adfs/backend.py @@ -92,7 +92,7 @@ def process_access_token(self, access_token, adfs_response=None): claims = self.validate_access_token(access_token) if ( settings.BLOCK_GUEST_USERS - and claims.get('http://schemas.microsoft.com/identity/claims/tenantid') + and claims.get('tid') != settings.TENANT_ID ): logger.info('Guest user denied') diff --git a/pyproject.toml b/pyproject.toml index 1ecdc9e..4c31249 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = 'django-auth-adfs' -version = '1.8.0' # Remember to also change __init__.py version +version = '1.8.1' # Remember to also change __init__.py version description = 'A Django authentication backend for Microsoft ADFS and AzureAD' authors = ['Joris Beckers '] maintainers = ['Jonas Krüger Svensson ', 'Sondre Lillebø Gundersen '] diff --git a/tests/utils.py b/tests/utils.py index 78d5b25..5cee25e 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -112,7 +112,7 @@ def do_build_access_token(request, issuer, schema=None): "ver": "1.0" } if schema: - claims['http://schemas.microsoft.com/identity/claims/tenantid'] = schema + claims['tid'] = schema if issuer.startswith('https://sts.windows.net'): claims['upn'] = 'testuser' claims['groups'] = claims['group']