Skip to content

Commit 75a286a

Browse files
committed
Let e2e test use PCA or CCA rather than base class
1 parent 2510796 commit 75a286a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/test_e2e.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,14 @@ def _get_app_and_auth_code(
2323
scopes=["https://graph.microsoft.com/.default"], # Microsoft Graph
2424
**kwargs):
2525
from msal.oauth2cli.authcode import obtain_auth_code
26-
app = msal.ClientApplication(
27-
client_id, client_secret, authority=authority, http_client=MinimalHttpClient())
26+
if client_secret:
27+
app = msal.ConfidentialClientApplication(
28+
client_id,
29+
client_credential=client_secret,
30+
authority=authority, http_client=MinimalHttpClient())
31+
else:
32+
app = msal.PublicClientApplication(
33+
client_id, authority=authority, http_client=MinimalHttpClient())
2834
redirect_uri = "http://localhost:%d" % port
2935
ac = obtain_auth_code(port, auth_uri=app.get_authorization_request_url(
3036
scopes, redirect_uri=redirect_uri, **kwargs))

0 commit comments

Comments
 (0)