Conversation
| - an error response would contain "error" and usually "error_description". | ||
| """ | ||
| data = kwargs.pop("data", {}) | ||
| data["fmi_path"] = fmi_path |
There was a problem hiding this comment.
Are the tokens cached like in MSAL .NET and MSAL GO? I don't think they are.
I see a PR here that look at proper caching #759 but I am not sure it is compliant with the rest.
There was a problem hiding this comment.
Added a cache enhancement so now we create a hash key for some data keyvalues
| self.token_cache.remove_at(at) | ||
| # acquire_token_for_client() obtains no RTs, so we have no RT to remove | ||
|
|
||
| def acquire_token_for_client_with_fmi_path(self, scopes, fmi_path, claims_challenge=None, **kwargs): |
There was a problem hiding this comment.
Should we have FMI path as one of the kwargs instead? Creating an entire new API seems pretty heavy.
There was a problem hiding this comment.
This comment still stands. Should we "an overload" of AcquireTokenForClient existing API?
| # Included fields (examples — anything NOT in this set is included): | ||
| # - "fmi_path" : Federated Managed Identity credential path | ||
| # - any future extra body parameter that should isolate cache entries | ||
| _EXT_CACHE_KEY_EXCLUDED_FIELDS = frozenset({ |
There was a problem hiding this comment.
Pls add a comment that these fields are already taken care of separately.
| "key_id", | ||
| "token_type", | ||
| "req_cnf", | ||
| "claims", |
There was a problem hiding this comment.
I think you are missing a few things:
- client_assertion and client_assertion_type and client_secret
- grant_type
- force_refresh
We probably need to enhance existing tests to assert that no "unknown" key is used.
| logger = logging.getLogger(__name__) | ||
| _GRANT_TYPE_BROKER = "broker" | ||
|
|
||
| # Fields in the request data dict that should NOT be included in the extended |
There was a problem hiding this comment.
The .NET spec mentioned using "atext" in the cache key. Maybe we are missing a test that attempts to load a token from a file.
Add
acquire_token_for_client_with_fmi_path()for FMI supportAdds a new method to
ConfidentialClientApplicationfor acquiring tokens with a Federated Managed Identity (FMI) path. It wrapsacquire_token_for_client(), injectingfmi_pathinto the request body while preserving all existing caching, telemetry, and regional endpoint behavior.Usage
E2E test
Added E2E test to msid client