Skip to content

Commit 074d77b

Browse files
committed
♻️ Minimise requested delegated scope
1 parent f0751b6 commit 074d77b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

apricot/oauth/microsoft_entra_client.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,14 @@ def __init__(
2323
@param entra_tenant_id: Tenant ID for the Entra ID
2424
"""
2525
redirect_uri = "urn:ietf:wg:oauth:2.0:oob" # this is the "no redirect" URL
26-
scopes = ["https://graph.microsoft.com/.default"] # this is the default scope
2726
token_url = (
2827
f"https://login.microsoftonline.com/{entra_tenant_id}/oauth2/v2.0/token"
2928
)
30-
self.tenant_id = entra_tenant_id
29+
# Use default application scope and minimal delegated scopes
3130
super().__init__(
3231
redirect_uri=redirect_uri,
33-
scopes_application=scopes,
34-
scopes_delegated=scopes,
32+
scopes_application=["https://graph.microsoft.com/.default"],
33+
scopes_delegated=["openid"],
3534
token_url=token_url,
3635
**kwargs,
3736
)

0 commit comments

Comments
 (0)