Added email in the PingOne and added "email" in the scope of abp project. Now email is coming in the claims. So forced abp to check email only using options.Events.OnUserInformationReceived = ctx => { options.ClaimActions.MapUniqueJsonKey(ClaimTypes.Email, "email"); return Task.CompletedTask; };
options.Events = new OpenIdConnectEvents { OnTokenValidated = context => { return Task.CompletedTask; } } we go from ABP -> PingOne -> Userlogs in -> Comes back to OnTokenValidated in ABP ->Enters OnUserInformationReceived in ABP-> I see email in the claim fine but ABP gives this error: Any suggestion ?
An unhandled exception occurred while processing the request. InvalidOperationException: The instance of entity type 'IdentityUserLogin' cannot be tracked because another instance with the same key value for {'UserId', 'LoginProvider'} is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.
ABP Logs:
3/12/2025 2:58:25 PM [Information] Executed page "/Account/Login" in 579.6282ms
3/12/2025 2:58:25 PM [Information] Executed endpoint '"/Account/Login"'
3/12/2025 2:58:25 PM [Error] System.InvalidOperationException: The instance of entity type 'IdentityUserLogin' cannot be tracked because another instance with the same key value for {'UserId', 'LoginProvider'} is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap1.ThrowIdentityConflict(InternalEntityEntry entry) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap
1.Add(TKey key, InternalEntityEntry entry, Boolean updateDuplicate)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap1.Add(TKey key, InternalEntityEntry entry) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.NullableKeyIdentityMap
1.Add(InternalEntityEntry entry)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.StartTracking(InternalEntityEntry entry)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState(EntityState oldState, EntityState newState, Boolean acceptChanges, Boolean modifyProperties)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState(EntityState entityState, Boolean acceptChanges, Boolean modifyProperties, Nullable1 forceStateWhenUnknownKey, Nullable
1 fallbackState)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.PaintAction(EntityEntryGraphNode1 node) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityEntryGraphIterator.TraverseGraph[TState](EntityEntryGraphNode
1 node, Func2 handleNode) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.AttachGraph(InternalEntityEntry rootEntry, EntityState targetState, EntityState storeGeneratedWithKeySetTargetState, Boolean forceStateWhenUnknownKey) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.NavigationFixer.NavigationCollectionChanged(InternalEntityEntry entry, INavigationBase navigationBase, IEnumerable
1 added, IEnumerable1 removed) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntryNotifier.NavigationCollectionChanged(InternalEntityEntry entry, INavigationBase navigationBase, IEnumerable
1 added, IEnumerable1 removed) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.ChangeDetector.DetectNavigationChange(InternalEntityEntry entry, INavigationBase navigationBase) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.ChangeDetector.LocalDetectChanges(InternalEntityEntry entry) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.ChangeDetector.DetectChanges(IStateManager stateManager) at Microsoft.EntityFrameworkCore.ChangeTracking.ChangeTracker.DetectChanges() at Microsoft.EntityFrameworkCore.Internal.InternalDbSet
1.get_Local()
at Volo.Abp.Domain.Repositories.EntityFrameworkCore.EfCoreRepository2.UpdateAsync(TEntity entity, Boolean autoSave, CancellationToken cancellationToken) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue
1.ProceedAsync()
at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func
3 proceed)
at Volo.Abp.Identity.IdentityUserStore.UpdateAsync(IdentityUser user, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Identity.UserManager1.UpdateUserAsync(TUser user) at Volo.Abp.Identity.IdentityUserManager.UpdateUserAsync(IdentityUser user) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue
1.ProceedAsync()
at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func
3 proceed)
at Microsoft.AspNetCore.Identity.UserManager1.AddLoginAsync(TUser user, UserLoginInfo login) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue
1.ProceedAsync()
Not sure, if related but externalprovidermap does not have PingOne:
Hi Enisn, Thank you for the information. I have collected some logs. Any suggestion ?
3/11/2025 1:45:41 PM [Information] Request starting "HTTP/2" "POST" "https"://"auth.cpat.com:44324""""/signin-oidc""" - "application/x-www-form-urlencoded" 1590 3/11/2025 1:45:41 PM [Information] CORS policy execution successful. 3/11/2025 1:45:41 PM [Debug] The event "OpenIddict.Validation.OpenIddictValidationEvents+ProcessRequestContext" was successfully processed by "OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ResolveRequestUri". 3/11/2025 1:45:41 PM [Debug] The event "OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext" was successfully processed by "OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ResolveRequestUri". 3/11/2025 1:45:41 PM [Debug] The event "OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext" was successfully processed by "OpenIddict.Server.OpenIddictServerHandlers+InferEndpointType". 3/11/2025 1:45:41 PM [Debug] The event "OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext" was successfully processed by "Volo.Abp.Account.Web.Pages.Account.OpenIddictImpersonateInferEndpointType". 3/11/2025 1:45:41 PM [Debug] The event "OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext" was successfully processed by "OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ValidateHostHeader". 3/11/2025 1:45:41 PM [Information] AuthenticationScheme: "Identity.External" signed in. 3/11/2025 1:45:41 PM [Information] Request finished "HTTP/2" "POST" "https"://"auth.cpat.com:44324""""/signin-oidc""" - 302 null null 615.6755ms 3/11/2025 1:45:41 PM [Information] Request starting "HTTP/2" "GET" "https"://"auth.cpat.com:44324""""/Account/Login""?ReturnUrl=%2Fconnect%2Fauthorize%3Fclient_id%3DTMS_MVC_Web%26redirect_uri%3Dhttps%253A%252F%252Fauth.cpat.com%253A44346%252Fsignin-oidc%26response_type%3Dcode%2520id_token%26scope%3Dopenid%2520profile%2520roles%2520email%2520phone%2520TMS_MVC%26response_mode%3Dform_post%26nonce%3D638772974889462698.NmRkMjdjODMtNjljYi00MGMzLTkzMDYtNGY1MGNlZDA2NDAzMzc4MDdmNjktMjJiYS00NjY2LTkzZTItNDUyNTg3ZTVmYzJm%26state%3DCfDJ8EwZ5r9h8qdOvrPa4ioX0Fdluzy8_QgqiMiwOJUl41lBSUiNtpfzj93NGkpkpk3jhY-ld_Os6YRlEubI0LLEj3gyYbSTf_EtsBlufePOeleDohFlhwzYpvqL3MIEWLhiZ0ZKkIk3xxB8gb7BpIf_o460ksoSd4taJYG5Bknd7Zke1-ctYcuK58Ncl7xqE4e5cRw4HIapqtr9pWZhZj6hIr2cJ8WS8q7tUCgVC1E1elRTJzQ_NzVN3guz04zoqf6Kmb2coG8Kof4JXVXFXC6bP47hyoK2qpr_NoPbc83hV8TQ%26x-client-SKU%3DID_NET9_0%26x-client-ver%3D8.1.0.0&handler=ExternalLoginCallback" - null null 3/11/2025 1:45:41 PM [Debug] The event "OpenIddict.Validation.OpenIddictValidationEvents+ProcessRequestContext" was successfully processed by "OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ResolveRequestUri". 3/11/2025 1:45:41 PM [Debug] The event "OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext" was successfully processed by "OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ResolveRequestUri". 3/11/2025 1:45:41 PM [Debug] The event "OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext" was successfully processed by "OpenIddict.Server.OpenIddictServerHandlers+InferEndpointType". 3/11/2025 1:45:41 PM [Debug] The event "OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext" was successfully processed by "Volo.Abp.Account.Web.Pages.Account.OpenIddictImpersonateInferEndpointType". 3/11/2025 1:45:41 PM [Debug] The event "OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext" was successfully processed by "OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ValidateHostHeader". 3/11/2025 1:45:41 PM [Debug] The event "OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext" was successfully processed by "OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ValidateHostHeader". 3/11/2025 1:45:41 PM [Debug] The event "OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext" was successfully processed by "OpenIddict.Validation.OpenIddictValidationHandlers+EvaluateValidatedTokens". 3/11/2025 1:45:41 PM [Debug] The event "OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext" was successfully processed by "OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ExtractAccessTokenFromAuthorizationHeader". 3/11/2025 1:45:41 PM [Debug] The event "OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext" was successfully processed by "OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ExtractAccessTokenFromBodyForm". 3/11/2025 1:45:41 PM [Debug] The event "OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext" was successfully processed by "OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ExtractAccessTokenFromQueryString". 3/11/2025 1:45:41 PM [Debug] The event "OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext" was successfully processed by "OpenIddict.Validation.OpenIddictValidationHandlers+ValidateRequiredTokens". 3/11/2025 1:45:41 PM [Debug] The event "OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext" was marked as rejected by "OpenIddict.Validation.OpenIddictValidationHandlers+ValidateRequiredTokens". 3/11/2025 1:45:41 PM [Debug] AuthenticationScheme: "OpenIddict.Validation.AspNetCore" was not authenticated. 3/11/2025 1:45:41 PM [Information] Executing endpoint '"/Account/Login"' 3/11/2025 1:45:41 PM [Information] Route matched with "{page = "/Account/Login", area = "", action = "", controller = ""}". Executing page "/Account/Login" 3/11/2025 1:45:41 PM [Information] Skipping the execution of current filter as its not the most effective filter implementing the policy Microsoft.AspNetCore.Mvc.ViewFeatures.IAntiforgeryPolicy 3/11/2025 1:45:41 PM [Information] Executing handler method "Volo.Abp.Account.Public.Web.Pages.Account.LoginModel.OnGetExternalLoginCallbackAsync" - ModelState is Valid 3/11/2025 1:45:42 PM [Information] Executed handler method "OnGetExternalLoginCallbackAsync", returned result "Microsoft.AspNetCore.Mvc.RedirectToPageResult". 3/11/2025 1:45:42 PM [Information] Executing RedirectToPageResult, redirecting to "./Register". 3/11/2025 1:45:42 PM [Information] Executed endpoint '"/Account/Login"' 3/11/2025 1:45:42 PM [Information] Request finished "HTTP/2" "GET" "https"://"auth.cpat.com:44324""""/Account/Login""?ReturnUrl=%2Fconnect%2Fauthorize%3Fclient_id%3DTMS_MVC_Web%26redirect_uri%3Dhttps%253A%252F%252Fauth.cpat.com%253A44346%252Fsignin-oidc%26response_type%3Dcode%2520id_token%26scope%3Dopenid%2520profile%2520roles%2520email%2520phone%2520TMS_MVC%26response_mode%3Dform_post%26nonce%3D638772974889462698.NmRkMjdjODMtNjljYi00MGMzLTkzMDYtNGY1MGNlZDA2NDAzMzc4MDdmNjktMjJiYS00NjY2LTkzZTItNDUyNTg3ZTVmYzJm%26state%3DCfDJ8EwZ5r9h8qdOvrPa4ioX0Fdluzy8_QgqiMiwOJUl41lBSUiNtpfzj93NGkpkpk3jhY-ld_Os6YRlEubI0LLEj3gyYbSTf_EtsBlufePOeleDohFlhwzYpvqL3MIEWLhiZ0ZKkIk3xxB8gb7BpIf_o460ksoSd4taJYG5Bknd7Zke1-ctYcuK58Ncl7xqE4e5cRw4HIapqtr9pWZhZj6hIr2cJ8WS8q7tUCgVC1E1elRTJzQ_NzVN3guz04zoqf6Kmb2coG8Kof4JXVXFXC6bP47hyoK2qpr_NoPbc83hV8TQ%26x-client-SKU%3DID_NET9_0%26x-client-ver%3D8.1.0.0&handler=ExternalLoginCallback" - 302 null null 429.8414ms 3/11/2025 1:45:42 PM [Information] Request starting "HTTP/2" "GET" "https"://"auth.cpat.com:44324""""/Account/Register""?isExternalLogin=True&returnUrl=%2Fconnect%2Fauthorize%3Fclient_id%3DTMS_MVC_Web%26redirect_uri%3Dhttps%253A%252F%252Fauth.cpat.com%253A44346%252Fsignin-oidc%26response_type%3Dcode%2520id_token%26scope%3Dopenid%2520profile%2520roles%2520email%2520phone%2520TMS_MVC%26response_mode%3Dform_post%26nonce%3D638772974889462698.NmRkMjdjODMtNjljYi00MGMzLTkzMDYtNGY1MGNlZDA2NDAzMzc4MDdmNjktMjJiYS00NjY2LTkzZTItNDUyNTg3ZTVmYzJm%26state%3DCfDJ8EwZ5r9h8qdOvrPa4ioX0Fdluzy8_QgqiMiwOJUl41lBSUiNtpfzj93NGkpkpk3jhY-ld_Os6YRlEubI0LLEj3gyYbSTf_EtsBlufePOeleDohFlhwzYpvqL3MIEWLhiZ0ZKkIk3xxB8gb7BpIf_o460ksoSd4taJYG5Bknd7Zke1-ctYcuK58Ncl7xqE4e5cRw4HIapqtr9pWZhZj6hIr2cJ8WS8q7tUCgVC1E1elRTJzQ_NzVN3guz04zoqf6Kmb2coG8Kof4JXVXFXC6bP47hyoK2qpr_NoPbc83hV8TQ%26x-client-SKU%3DID_NET9_0%26x-client-ver%3D8.1.0.0" - null null 3/11/2025 1:45:42 PM [Debug] The event "OpenIddict.Validation.OpenIddictValidationEvents+ProcessRequestContext" was successfully processed by "OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ResolveRequestUri". 3/11/2025 1:45:42 PM [Debug] The event "OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext" was successfully processed by "OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ResolveRequestUri". 3/11/2025 1:45:42 PM [Debug] The event "OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext" was successfully processed by "OpenIddict.Server.OpenIddictServerHandlers+InferEndpointType". 3/11/2025 1:45:42 PM [Debug] The event "OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext" was successfully processed by "Volo.Abp.Account.Web.Pages.Account.OpenIddictImpersonateInferEndpointType". 3/11/2025 1:45:42 PM [Debug] The event "OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext" was successfully processed by "OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ValidateHostHeader". 3/11/2025 1:45:42 PM [Debug] The event "OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext" was successfully processed by "OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ValidateHostHeader". 3/11/2025 1:45:42 PM [Debug] The event "OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext" was successfully processed by "OpenIddict.Validation.OpenIddictValidationHandlers+EvaluateValidatedTokens". 3/11/2025 1:45:42 PM [Debug] The event "OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext" was successfully processed by "OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ExtractAccessTokenFromAuthorizationHeader". 3/11/2025 1:45:42 PM [Debug] The event "OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext" was successfully processed by "OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ExtractAccessTokenFromBodyForm". 3/11/2025 1:45:42 PM [Debug] The event "OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext" was successfully processed by "OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ExtractAccessTokenFromQueryString". 3/11/2025 1:45:42 PM [Debug] The event "OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext" was successfully processed by "OpenIddict.Validation.OpenIddictValidationHandlers+ValidateRequiredTokens". 3/11/2025 1:45:42 PM [Debug] The event "OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext" was marked as rejected by "OpenIddict.Validation.OpenIddictValidationHandlers+ValidateRequiredTokens". 3/11/2025 1:45:42 PM [Debug] AuthenticationScheme: "OpenIddict.Validation.AspNetCore" was not authenticated. 3/11/2025 1:45:42 PM [Information] Executing endpoint '"/Account/Register"'
Using .AddOpenIdConnect to connect with PingOne authentication. I can reach PingOne and Authentication happens fine but redirect url is taking me to logOut instead of login. How do I enforce login after user is authenticated properly. My redirect url is working fine with Azure AD authentication and same URL logs me out in Ping One. Did I miss anything ?
In Authserver Is there a way to send UserLoggedInEvent on event bus. context.Services.AddAuthentication(options => { options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme; options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; }) .AddCookie() .AddOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme, "PingFederated login", options => { options.SignInScheme = IdentityConstants.ExternalScheme; //CookieAuthenticationDefaults.AuthenticationScheme; options.ResponseType = "code";// OpenIdConnectResponseType.Code;// CodeIdToken;//.CodeIdToken; options.SaveTokens = true;
options.Scope.Add("openid");
options.Scope.Add("email");
options.GetClaimsFromUserInfoEndpoint = true;
options.RequireHttpsMetadata = false;
options.UsePkce = true;
options.ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "sub");
options.MapInboundClaims = false;
options.PushedAuthorizationBehavior = PushedAuthorizationBehavior.Disable;
options.CallbackPath = "/signin-oidc";
//added
options.SignedOutCallbackPath = "/signout-callback-oidc";
options.RemoteSignOutPath = "/signout-oidc";
options.Events = new OpenIdConnectEvents
{
OnTokenValidated = context =>
{
// I want to send user logged in event to ABP when PingID login is successful
},
OnAuthenticationFailed = context =>
{
context.HandleResponse();
context.Response.Redirect("/Home/Error");
return Task.CompletedTask;
}
}
Thank you
Hi, I can get ProcessSignOutContext event fine. But Not getting ProcessSignInContext event in the Authserver. I have a class and registered it using
PreConfigure<OpenIddictServerBuilder>(serverBuilder =>
{
serverBuilder.AddEventHandler(SignInControl.Descriptor);
});
public class SignInControl : IOpenIddictServerHandler<ProcessSignInContext>
{
public static OpenIddictServerHandlerDescriptor Descriptor { get; }
= OpenIddictServerHandlerDescriptor.CreateBuilder<ProcessSignInContext>()
.UseSingletonHandler<OpenIddictCreateIdentitySession>()
.SetOrder(100_000)
.SetType(OpenIddictServerHandlerType.Custom)
.Build();
protected IdentitySessionManager IdentitySessionManager { get; }
protected IWebClientInfoProvider WebClientInfoProvider { get; }
protected IOptions<AbpAccountOpenIddictOptions> Options { get; }
public SignInControl(IdentitySessionManager identitySessionManager, IWebClientInfoProvider webClientInfoProvider, IOptions<AbpAccountOpenIddictOptions> options)
{
IdentitySessionManager = identitySessionManager;
WebClientInfoProvider = webClientInfoProvider;
Options = options;
}
public ValueTask HandleAsync(ProcessSignInContext context)
{
//...
}
}
Hi Enisn, Thank you for your response. We are multi-tiered MVC, multitenant application. I want to authenticate users of one tenant with Azure AD only and users of another tenant with Google authentication only. The user may be part of ABP database but if the user is not part of Azure AD or Google, the ABP based application should not allow that user to login. How do I implement this feature?