AzureAD / microsoft-authentication-extensions-for-dotnet

Secure cross-platform token cache for MSAL public client apps
MIT License
83 stars 32 forks source link

AadIssuerValidator usage #30

Closed ghost closed 5 years ago

ghost commented 5 years ago

The code in this file: https://github.com/AzureAD/microsoft-authentication-extensions-for-dotnet/blob/master/src/Microsoft.Identity.Client.Extensions.Web/Resource/AadIssuerValidator.cs

is replicated in many MSFT samples using AADv2, aka https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/blob/master/Microsoft.Identity.Web/Resource/AadIssuerValidator.cs

Also, this code is not part of a nuget package, even a preview, at this time.

should one just copy this code into their own project if they want to use the AadIssuerValidator?

jmprieur commented 5 years ago

@rhizohm we are working on productizing this code (coming from samples indeed), with the goal of releasing a NuGet package cc: @MarkZuber @brentschmaltz @henrik-me

henrik-me commented 5 years ago

@jmprieur @MarkZuber : Perhaps we should add a roadmap to the wiki?

jmprieur commented 5 years ago

@henrik-me : yes we should

brentschmaltz commented 5 years ago

@jmprieur @henrik-me I did first pass cleanup of AadIssuerValidator.

jmprieur commented 5 years ago

@brentschmaltz can I merge all the changes you proposed in the PR? (I would think so)

cc: @jmprieur @MarkZuber @kalyankrishna1 @TiagoBrenck

brentschmaltz commented 5 years ago

@jmprieur please pull them in. I expect to be able to continue in about a week. Is there any specific place you would like to prioritize?

allenwux commented 5 years ago

Any update on this? It is very confusing if the sample code in documentation doesn't work.

jmprieur commented 5 years ago

@allenwux : did you mean that https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/blob/master/Microsoft.Identity.Web/Resource/AadIssuerValidator.cs still does not work? We have unit tests etc .... are we missing a case? can you please elaborate ?

allenwux commented 5 years ago

the code sample in the documentation doesn't work: https://docs.microsoft.com/en-us/azure/active-directory/develop/scenario-web-app-sign-user-app-configuration

Can't find the AadIssuerValidator class after adding the nuget package

That documentation page needs some update anyway. I was not able to follow it.

udlose commented 5 years ago

Is this in a nuget package yet for AspNetCore v2.2?

jmprieur commented 5 years ago

@udlose : not yet. Meanwhile you can use the following project: https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/blob/master/Microsoft.Identity.Web/README.md

jmprieur commented 5 years ago

@allenwux : I plan to update https://docs.microsoft.com/en-us/azure/active-directory/develop/scenario-web-app-sign-user-app-configuration soon

jmprieur commented 5 years ago

I made it clear that the code is no longer here. See PR https://github.com/AzureAD/microsoft-authentication-extensions-for-dotnet/pull/45

See https://github.com/AzureAD/microsoft-authentication-extensions-for-dotnet/tree/master/src/Microsoft.Identity.Client.Extensions.Web