Skip to content

Commit

Permalink
Merge pull request #180 from snok/fix_guest_user_setting
Browse files Browse the repository at this point in the history
Fix guest user setting
  • Loading branch information
JonasKs authored Aug 27, 2021
2 parents 4210666 + 0e733f6 commit bd338c2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -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
---------------------

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion django_auth_adfs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
Adding imports here will break setup.py
"""

__version__ = '1.8.0'
__version__ = '1.8.1'
2 changes: 1 addition & 1 deletion django_auth_adfs/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>']
maintainers = ['Jonas Krüger Svensson <[email protected]>', 'Sondre Lillebø Gundersen <[email protected]>']
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit bd338c2

Please sign in to comment.