Skip to content

Commit

Permalink
Fixes Microsoft Entra ID authentication for multi-tenant app registra…
Browse files Browse the repository at this point in the history
…tions by adding missing token validation.

Fixes OrchardCMS#14802
  • Loading branch information
gvkries committed Apr 2, 2024
1 parent 52ec367 commit 3511f94
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Microsoft.Extensions.Options;
using Microsoft.Identity.Web;
using Microsoft.IdentityModel.Validators;
using OrchardCore.Microsoft.Authentication.Settings;
using MicrosoftIdentityDefaults = Microsoft.Identity.Web.Constants;

Expand Down Expand Up @@ -38,7 +39,7 @@ public void Configure(string name, OpenIdConnectOptions options)
options.SignInScheme = "Identity.External";
options.UseTokenLifetime = true;
options.SaveTokens = _azureADSettings.SaveTokens;

options.TokenValidationParameters.IssuerValidator = AadIssuerValidator.GetAadIssuerValidator(options.Authority, options.Backchannel).Validate;
}

public void Configure(OpenIdConnectOptions options) => Debug.Fail("This infrastructure method shouldn't be called.");
Expand Down

0 comments on commit 3511f94

Please sign in to comment.