|
7 | 7 | import time |
8 | 8 | import uuid |
9 | 9 |
|
| 10 | +from .sku import __version__, SKU |
10 | 11 |
|
11 | 12 | logger = logging.getLogger(__name__) |
12 | 13 | try: |
@@ -135,13 +136,18 @@ def _get_new_correlation_id(): |
135 | 136 | def _enable_msa_pt(params): |
136 | 137 | params.set_additional_parameter("msal_request_type", "consumer_passthrough") # PyMsalRuntime 0.8+ |
137 | 138 |
|
| 139 | +def _build_msal_runtime_auth_params(client_id, authority): |
| 140 | + params = pymsalruntime.MSALRuntimeAuthParameters(client_id, authority) |
| 141 | + params.set_additional_parameter("msal_client_sku", SKU) |
| 142 | + params.set_additional_parameter("msal_client_ver", __version__) |
| 143 | + return params |
138 | 144 |
|
139 | 145 | def _signin_silently( |
140 | 146 | authority, client_id, scopes, correlation_id=None, claims=None, |
141 | 147 | enable_msa_pt=False, |
142 | 148 | auth_scheme=None, |
143 | 149 | **kwargs): |
144 | | - params = pymsalruntime.MSALRuntimeAuthParameters(client_id, authority) |
| 150 | + params = _build_msal_runtime_auth_params(client_id, authority) |
145 | 151 | params.set_requested_scopes(scopes) |
146 | 152 | if claims: |
147 | 153 | params.set_decoded_claims(claims) |
@@ -174,7 +180,7 @@ def _signin_interactively( |
174 | 180 | enable_msa_pt=False, |
175 | 181 | auth_scheme=None, |
176 | 182 | **kwargs): |
177 | | - params = pymsalruntime.MSALRuntimeAuthParameters(client_id, authority) |
| 183 | + params = _build_msal_runtime_auth_params(client_id, authority) |
178 | 184 | params.set_requested_scopes(scopes) |
179 | 185 | params.set_redirect_uri( |
180 | 186 | _redirect_uri_on_mac if sys.platform == "darwin" else |
@@ -230,7 +236,7 @@ def _acquire_token_silently( |
230 | 236 | account = _read_account_by_id(account_id, correlation_id) |
231 | 237 | if account is None: |
232 | 238 | return |
233 | | - params = pymsalruntime.MSALRuntimeAuthParameters(client_id, authority) |
| 239 | + params = _build_msal_runtime_auth_params(client_id, authority) |
234 | 240 | params.set_requested_scopes(scopes) |
235 | 241 | if claims: |
236 | 242 | params.set_decoded_claims(claims) |
|
0 commit comments