Hi Guys,
I'm trying to add Azure AD authentication to an angular radzen app (.net core 3.1). I added packages to server project:
Microsoft.AspNetCore.Authentication.AzureAD.UI --version 3.1.1
Microsoft.AspNetCore.Authentication --version 3.1.1
Next, I created a Startup.Custom.cs file and wrote this:
partial void OnConfigureServices(IServiceCollection services)
{
services.Configure<CookiePolicyOptions>(options =>
{
options.CheckConsentNeeded = context => true;
options.MinimumSameSitePolicy = SameSiteMode.None;
});
services.AddAuthentication(AzureADDefaults.AuthenticationScheme)
.AddAzureAD(options => Configuration.Bind("AzureAd", options));
services.Configure<OpenIdConnectOptions>(AzureADDefaults.OpenIdScheme, options =>
{
options.Authority = options.Authority + "/v2.0/";
options.TokenValidationParameters.ValidateIssuer = false;
});
}
Later I added entries in appsettings.json to describe Azure AD parameters:
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "xxx.onmicrosoft.com",
"TenantId": "...",
"ClientId": "...",
"CallbackPath": "/signin-oidc"
}
When I try to run project error message is shown:
radzen: Generating code ...
radzen: Code generation done in 467ms.
dotnet: Unhandled exception.
dotnet: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.Razor.Runtime, Version=3.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. El sistema no puede encontrar el archivo especificado.
I try to add this package however error doesn't disappear. Any clues?
Thanks in advance.