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
Which version of Microsoft Identity Abstractions for dotnet are you using?
Microsoft Identity Abstractions version 5.3.0 via Microsoft.Identity.Web.DownstreamApi version 2.18.1
Is this a new or an existing app?
New app
Repro
Debug an ASP.NET 8.0 application using multiple IDP's and Azure Web PubSub.
// IDP 1
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddMicrosoftIdentityWebApi(builder.Configuration.GetSection("EntraExternalID")).EnableTokenAcquisitionToCallDownstreamApi().AddDownstreamApi("ServiceA", builder.Configuration.GetSection("ServiceA")).AddDownstreamApi("ServiceB", builder.Configuration.GetSection("ServiceB")).AddInMemoryTokenCaches();// IDP 2
builder.Services.AddAuthentication().AddMicrosoftIdentityWebApi(builder.Configuration.GetSection("EntraID"),"EntraID");// Add Web PubSub Service Client
builder.Services.AddWebPubSub(options =>{varconfig= builder.Configuration.GetSection("Config").Get<Configuration<Config>>(); options.ServiceEndpoint =new WebPubSubServiceEndpoint(config.ConnectionString);}).AddWebPubSubServiceClient<webpubsub>();// standard init in between e.g. var app = builder.Build();// Further down map web pubsub event handler
app.UseAuthentication();
app.UseAuthorization();
app.MapControllers();
app.MapWebPubSubHub<webpubsub>("/eventhandler/{*path}");
app.Run();
Expected behavior
Error is not observed when debugging on Windows via Visual Studio.
Actual behavior
The call to app.MapWebPubSubHub<webpubsub>("/eventhandler/{*path}"); triggers System.InvalidOperationException: 'Cannot resolve scoped service 'Microsoft.Identity.Abstractions.IDownstreamApi' from root provider.' only when debugging via Visual Studio (latest version - 17.9.6) on Windows. When run in a Linux Container the app runs fine.
Possible solution
N/A
The text was updated successfully, but these errors were encountered:
The SDK Azure.Messaging.WebPubSub is for the Azure Web PubSub service. This is workign when running via a Linux docker container, just not when debugging on Windows using Visual Studio so I don't think changing ID Web to a singleton will fix this. It depends on how things are being registered under the hood.
It's possible to be an issue in Microsoft.Identity.Web.DownstreamApi - from memory IDownstreamApi had been moved around and changed in the past so I don't recall why I logged it to this repo.
Which version of Microsoft Identity Abstractions for dotnet are you using?
Microsoft Identity Abstractions version 5.3.0 via Microsoft.Identity.Web.DownstreamApi version 2.18.1
Is this a new or an existing app?
New app
Repro
Debug an ASP.NET 8.0 application using multiple IDP's and Azure Web PubSub.
Expected behavior
Error is not observed when debugging on Windows via Visual Studio.
Actual behavior
The call to
app.MapWebPubSubHub<webpubsub>("/eventhandler/{*path}");
triggers System.InvalidOperationException: 'Cannot resolve scoped service 'Microsoft.Identity.Abstractions.IDownstreamApi' from root provider.' only when debugging via Visual Studio (latest version - 17.9.6) on Windows. When run in a Linux Container the app runs fine.Possible solution
N/A
The text was updated successfully, but these errors were encountered: