Closed nschuessler closed 1 month ago
It's being moved to MSAL.NET cc: @bgavrilMS
@bhavrilMS It appears the GetSignedAssertion
method has been moved in 3.0+. Is there an example of how code should be converted that used this method?
ClientAssertionCredential credential = new ClientAssertionCredential( resourceTenantId, aadClientId, new ManagedIdentityClientAssertion(msiClientId).GetSignedAssertion);
Appears this may be the solution:
ClientAssertionCredential credential = new ClientAssertionCredential(
resourceTenantId,
aadClientId,
async cancellationToken =>
{
var assertion = new ManagedIdentityClientAssertion(msiClientId);
AssertionRequestOptions options = new AssertionRequestOptions()
{
CancellationToken = cancellationToken,
};
return await assertion.GetSignedAssertionAsync(options);
});
It is done in 3.10
Microsoft.Identity.Web Library
Microsoft.Identity.Web
Microsoft.Identity.Web version
2.11.1
Web app
Sign-in users
Web API
Protected web APIs (validating tokens)
Token cache serialization
In-memory caches
Description
For the following code:
It requires the nuget
Microsoft.Identity.Web
which pulls in lots of ASP.Net libraries. If you need this authentication in a console app (to for example authenticate to an azure queue) then it exposes you to a lot of unnecessary dependencies which cause deployment and security issues keeping all those packages up to date.Shouldn't
ManagedIdentityClientAssertion
be moved to the main Azure.Identity library?Reproduction steps
Error message
N/A
Id Web logs
N/A
Relevant code snippets
Regression
No response
Expected behavior
We shouldn't have to have web specific libraries when doing general authentication tasks.