hi alexander.nikonov
You can consider disabling the anti-forgery check for the logout endpoint Can you share the logs.txt file? I will check and share the code to disable it.
liming.ma@volosoft.com
Thanks.
Great
We will add an option inthe tenant side to enable/disable it in the next version.
ok
hi
You can override the AuthenticationSchemeProvider
to remove external login based on the current tenant.
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Microsoft.AspNetCore.Authentication;
using Microsoft.Extensions.Options;
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
namespace Volo.Abp.Account.Public.Web;
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IAuthenticationSchemeProvider))]
public class MyAuthenticationSchemeProvider : AuthenticationSchemeProvider, ISingletonDependency
{
private readonly ICurrentTenant _currentTenant;
public MyAuthenticationSchemeProvider([NotNull] [ItemNotNull] IOptions<AuthenticationOptions> options, ICurrentTenant currentTenant)
: base(options)
{
_currentTenant = currentTenant;
}
protected MyAuthenticationSchemeProvider([NotNull] [ItemNotNull] IOptions<AuthenticationOptions> options, [NotNull] IDictionary<string, AuthenticationScheme> schemes, ICurrentTenant currentTenant)
: base(options, schemes)
{
_currentTenant = currentTenant;
}
public override async Task<IEnumerable<AuthenticationScheme>> GetAllSchemesAsync()
{
var schemes = (await base.GetAllSchemesAsync()).ToList();
if (_currentTenant.Name == "TenantA")
{
schemes.RemoveAll(x => x.Name == "AzureOpenId");
}
if (_currentTenant.Name == "TenantB")
{
schemes.RemoveAll(x => x.Name == "AzureOpenId");
schemes.RemoveAll(x => x.Name == "Google");
}
return schemes;
}
}
Clone https://github.com/maliming/NextGenPortal/ change connection string migrate database login admin change the azure configuration create a new tenant change your tenant azure configuration in a tenant.
Test your steps.
Can you test your configuration in my project? So I can get the same exception.