hi
This is just a sample project, you can change it according to your needs, we will upgrade it in the near future.
Thanks
I will fix this problem in the next version.
: )
Use WithDynamicOptions
will automatically add UI. Settings => Account => External provider
How to configure O365 external provider.
You can search it in Google. I don't know O365.
hi
.AddOpenIdConnect("AzureOpenId", "Azure AD", options =>
{
options.ResponseType = OpenIdConnectResponseType.CodeIdToken;
options.RequireHttpsMetadata = false;
options.SaveTokens = true;
options.GetClaimsFromUserInfoEndpoint = true;
options.Scope.Add("email");
options.ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "sub");
options.CallbackPath = "/callback";
})
.WithDynamicOptions<OpenIdConnectOptions, OpenIdConnectHandler>(
"AzureOpenId",
options =>
{
options.WithProperty(x => x.Authority);
options.WithProperty(x => x.ClientId);
options.WithProperty(x => x.ClientSecret, isSecret: true);
}
);
context.Services.Replace(ServiceDescriptor
.Scoped<AccountExternalProviderOptionsManager<OpenIdConnectOptions>,
OpenIdAccountExternalProviderOptionsManager>());
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.Extensions.Options;
using Volo.Abp.Account.ExternalProviders;
using Volo.Abp.Account.Public.Web.ExternalProviders;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Security.Encryption;
namespace MyCompanyName.MyProjectName.Web.OpenId;
public class OpenIdAccountExternalProviderOptionsManager : AccountExternalProviderOptionsManager<OpenIdConnectOptions>
{
private readonly OpenIdConnectPostConfigureOptions _openIdConnectPostConfigureOptions;
public OpenIdAccountExternalProviderOptionsManager(
IOptionsFactory<OpenIdConnectOptions> factory,
IAccountExternalProviderAppService accountExternalProviderAppService,
IStringEncryptionService stringEncryptionService,
ITenantConfigurationProvider tenantConfigurationProvider,
IDataProtectionProvider dataProtection) :
base(factory, accountExternalProviderAppService, stringEncryptionService, tenantConfigurationProvider)
{
_openIdConnectPostConfigureOptions = new OpenIdConnectPostConfigureOptions(dataProtection);
}
protected async override Task OverrideOptionsAsync(string name, OpenIdConnectOptions options)
{
await base.OverrideOptionsAsync(name, options);
_openIdConnectPostConfigureOptions.PostConfigure(name, options);
}
}
ok, I will check it asap.
C:\Users\your user name\.abp\suite\logs
hi
Can you share a sample project that includes the AddOpenIdConnect client secret
with me?
liming.ma@volosoft.com
hi
Update all ABP package versions to 5.1.3 in your project.
taskkill /F /im dotnet.exe
taskkill /F /im abp.exe
taskkill /F /im abp-suite.exe
You can run abp suite
in administrator mode.