ms-identity-docs-code-dotnet icon indicating copy to clipboard operation
ms-identity-docs-code-dotnet copied to clipboard

Are these examples still current and expected to run?

Open sam-wheat opened this issue 1 year ago • 1 comments

https://github.com/Azure-Samples/ms-identity-docs-code-dotnet/tree/main/web-app-aspnet

I tried to implement the project shown above however it repeatedly loops, asking for a password.

Before I get too far into troubleshooting it I want make sure this code is has not been deprecated as there is another example found here that works but uses different code.

Is this code still the recommended approach for web apps?

sam-wheat avatar Apr 27 '24 17:04 sam-wheat

Replace this:

IEnumerable<string>? initialScopes = builder.Configuration["DownstreamApi:Scopes"]?.Split(' ');

with this

IEnumerable<string>? initialScopes = builder.Configuration.GetSection("DownstreamApi:Scopes").Get<IEnumerable<string>>();

inside of Program.cs and it should work again.

dannoe avatar Jun 12 '24 21:06 dannoe