IdentityServer4.Admin
IdentityServer4.Admin copied to clipboard
Help with external provider connection Azure AD
Hello, I have made the connection adding the OIC configurations, but when I click on the button generated on the login page, it returns this error. Attached images of the code and the error.
Please check this article - how to setup azure ad: https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-v2-aspnet-core-webapp
If I use the integration specified in the associated documentation, the _singInManager.GetExternalLoginInfoAsync () method always returns null.
Hi, in our case we have the following configuration:
And in the appsettings.json we have this configuration:
We had some issues with the creation of the external user (AutoProvisionUserAsync) some claims didn't match but other than that everything worked.
In your case set the ValidateIssuer = false and remove the IssuerValidatior method because that is a custom implementation; But from what i can understand from your exception it seems that it might a problem of communication. Maybe your URL is not well created.
I am finally using this code. With it I have been able to solve the problem of _signInManager.ExternalLoginSignInAsync (). I don't know if it's the best option but it worked for me.
`
authenticationBuilder .AddAzureAD(AzureADDefaults.AuthenticationScheme,AzureADDefaults.OpenIdScheme,AzureADDefaults.CookieScheme,AzureADDefaults.DisplayName, options => { options.ClientId = externalProviderConfiguration.AzureADClientId; options.TenantId = externalProviderConfiguration.AzureADTenantId; options.Domain = externalProviderConfiguration.AzureADDomain; options.Instance = externalProviderConfiguration.AzureADInstance; options.CallbackPath = externalProviderConfiguration.AzureADCallbackPath; options.CookieSchemeName = IdentityConstants.ExternalScheme; });
`
Hi all,
Is it planned to integrate this configurable possibility to the main repo? For people who use built docker image it can be interesting i think. What do you think about that ? @skoruba In my case, i using built docker images rc3 and infact i would like to integrate azureAD authentication. I can implement in my side this configurable part and propose as PR if you want.
Valentin
Good idea, could you please send a PR? Thanksx.
@skoruba sure, i currently testing it on my side. I send PR this week for that :)
With the latest version of Skoruba Identity Server to make Identity with AzureAAD or any other Microsoft Identity protected auth system, you need to set cookieScheme parameter to null:
if (externalProviderConfiguration.UseAzureAdProvider)
{
authenticationBuilder.AddMicrosoftIdentityWebApp(options =>
{
options.ClientSecret = externalProviderConfiguration.AzureAdSecret;
options.ClientId = externalProviderConfiguration.AzureAdClientId;
options.TenantId = externalProviderConfiguration.AzureAdTenantId;
options.Instance = externalProviderConfiguration.AzureInstance;
options.Domain = externalProviderConfiguration.AzureDomain;
options.CallbackPath = externalProviderConfiguration.AzureAdCallbackPath;
}, cookieScheme: null);
}