Skip to content

Commit

Permalink
fix: do not hardcode scopes for azure AD v2
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKs committed Mar 30, 2023
1 parent 80adc32 commit 6518a6a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
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.11.4'
__version__ = '1.11.5'
5 changes: 4 additions & 1 deletion django_auth_adfs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,10 @@ def build_authorization_endpoint(self, request, disable_sso=None, force_mfa=Fals
})
if self._mode == "openid_connect":
if settings.VERSION == 'v2.0':
query["scope"] = f"openid api://{settings.RELYING_PARTY_ID}/.default"
if settings.RELYING_PARTY_ID == settings.CLIENT_ID:
query["scope"] = f"openid api://{settings.RELYING_PARTY_ID}/.default"
else:
query["scope"] = f"openid {settings.RELYING_PARTY_ID}"
query.pop("resource")
else:
query["scope"] = "openid"
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.11.4" # Remember to also change __init__.py version
version = "1.11.5" # 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

0 comments on commit 6518a6a

Please sign in to comment.