Skip to content

Commit d6233a7

Browse files
authority set up for user authentication (#1726)
2 parents 654aac6 + 57c7179 commit d6233a7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

admin_login/views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,13 @@ def _get_azure_signup_url(self):
5858
"""
5959
Generate the URL for Azure AD B2C authorization.
6060
"""
61-
authority = 'https://iogt.b2clogin.com/iogt.onmicrosoft.com/v2.0'
61+
tenant_id = get_azure_auth_details()['tenant_id']
6262
client_id = get_azure_auth_details()['client_id']
6363
redirect_uri = get_azure_auth_details()['redirect_uri']
6464
policy = get_azure_auth_details()['policy']
6565

66+
authority = f"https://{tenant_id}.b2clogin.com/{tenant_id}.onmicrosoft.com/v2.0"
67+
6668
# Construct the URL for Azure AD B2C login/signup
6769
signup_url = f"{authority}/oauth2/v2.0/authorize?p={policy}&client_id={client_id}&response_type=code&redirect_uri={redirect_uri}&scope=openid+profile+email"
6870
return signup_url

0 commit comments

Comments
 (0)