Skip to content

Commit bd338c2

Browse files
authored
Merge pull request #180 from snok/fix_guest_user_setting
Fix guest user setting
2 parents 4210666 + 0e733f6 commit bd338c2

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

CHANGELOG.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Changelog
22
=========
33

4+
`1.8.1`_ - 2021-08-27
5+
---------------------
6+
7+
**Features**
8+
9+
* Fix broken ``BLOCK_GUEST_USERS`` setting. @JonasKs #180
10+
11+
412
`1.8.0`_ - 2021-08-14
513
---------------------
614

@@ -253,6 +261,7 @@ Changelog
253261

254262
* Initial release
255263

264+
.. _1.8.1: https://github.com/snok/django-auth-adfs/compare/1.8.0...1.8.1
256265
.. _1.8.0: https://github.com/snok/django-auth-adfs/compare/1.7.0...1.8.0
257266
.. _1.7.0: https://github.com/snok/django-auth-adfs/compare/1.6.1...1.7.0
258267
.. _1.6.1: https://github.com/snok/django-auth-adfs/compare/1.6.0...1.6.1

django_auth_adfs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
Adding imports here will break setup.py
55
"""
66

7-
__version__ = '1.8.0'
7+
__version__ = '1.8.1'

django_auth_adfs/backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def process_access_token(self, access_token, adfs_response=None):
9292
claims = self.validate_access_token(access_token)
9393
if (
9494
settings.BLOCK_GUEST_USERS
95-
and claims.get('http://schemas.microsoft.com/identity/claims/tenantid')
95+
and claims.get('tid')
9696
!= settings.TENANT_ID
9797
):
9898
logger.info('Guest user denied')

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = 'django-auth-adfs'
3-
version = '1.8.0' # Remember to also change __init__.py version
3+
version = '1.8.1' # Remember to also change __init__.py version
44
description = 'A Django authentication backend for Microsoft ADFS and AzureAD'
55
authors = ['Joris Beckers <[email protected]>']
66
maintainers = ['Jonas Krüger Svensson <[email protected]>', 'Sondre Lillebø Gundersen <[email protected]>']

tests/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def do_build_access_token(request, issuer, schema=None):
112112
"ver": "1.0"
113113
}
114114
if schema:
115-
claims['http://schemas.microsoft.com/identity/claims/tenantid'] = schema
115+
claims['tid'] = schema
116116
if issuer.startswith('https://sts.windows.net'):
117117
claims['upn'] = 'testuser'
118118
claims['groups'] = claims['group']

0 commit comments

Comments
 (0)