You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
options.Events.OnRedirectToIdentityProviderForSignOut=async context =>{// Remove the account from MSAL.NET token cachevartokenAcquisition=context.HttpContext.RequestServices.GetRequiredService<ITokenAcquisitionInternal>();awaittokenAcquisition.RemoveAccountAsync(context).ConfigureAwait(false);awaitsignOutHandler(context).ConfigureAwait(false);};
How to achieve this?
Make one interface inherit from the other
In the DI container, we can do a registration that delegates to another registration. See an example in the .NET runtime code: https://github.com/dotnet/runtime/src/libraries/Microsoft.Extensions.Hosting/src/HostBuilder.cs#L214. So there is one normal registration and the other references the first one. Makes sense when one interface inherits from the other. Have to register it twice.
Needs to use the delegate form so that we get the same copy within the scope.
** Possible design**
Have ITokenAcquisitionInternal inherit from ITokenAcquisition
In ServiceCollectionExtensions.cs update the AddTokenAcquisition method to register the ITokenAcquisition service and the ITokenAcquistionInternal service, but turning out to be the same instance.
Change WebAppCallsWebApiAuthenticationBuilderExtensions.cs and WebAppCallsWebApiAuthenticationBuilderExtensions.cs to use only ITokenAcquisitionInternal
The text was updated successfully, but these errors were encountered:
Which Version of Microsoft Identity Web are you using ?
Microsoft Identity Web 0.1.5-preview
Is this a new or existing app?
Repro
Look at:
WebAppCallsWebApiAuthenticationBuilderExtensions.cs#L129
WebAppCallsWebApiAuthenticationBuilderExtensions.cs#L163
Expected behavior
We'd want to write code requesting only the
ITokenAcquisitionInternal
How to achieve this?
Needs to use the delegate form so that we get the same copy within the scope.
** Possible design**
ITokenAcquisitionInternal
inherit fromITokenAcquisition
AddTokenAcquisition
method to register the ITokenAcquisition service and the ITokenAcquistionInternal service, but turning out to be the same instance.(and same for the singleton)
ITokenAcquisitionInternal
The text was updated successfully, but these errors were encountered: