We noticed that the "Remember me" checkbox and "Remember this browser" (when Email 2fa is activated) does not have any impact on the next login.
Even though the Identity.TwoFactorRememberMe cookie does exists, and that the "signInManager.TwoFactorSignInAsync" have the correct parameters, this bellow always returns "RequiresTwoFactor" (again, only when email 2fa is activated for this account).
var signInResult = await _signInManager.SignInOrTwoFactorAsync(loginResult, loginModel.RememberMe); / if (signInResult.RequiresTwoFactor) { return Json(new AjaxResponse { TargetUrl = Url.Action( "SendSecurityCode", new { returnUrl = returnUrl, rememberMe = loginModel.RememberMe }) }); }
You can easily reproduce this with your default project. Just edit the default user to use Email 2fa, and try to check the "Remember me" and "Remember this browser" checkbox on the next login. You will always be prompted to enter your credentials and 2fa, so it appears it does not have any effect.
Hi @ismcagdas
The proposed solution did not worked and the same error keeps happening.
This first piece of code is the module from the project we added to the solution.
` [DependsOn(typeof(AbpEntityFrameworkCoreModule), typeof(AbpAspNetCoreModule))]
public class MyNewCoreModule : AbpModule
{
public override void Initialize()
{
IocManager.RegisterAssemblyByConvention(typeof(MyNewCoreModule).GetAssembly());
}
public override void PostInitialize()
{
IocManager.Resolve<ApplicationPartManager>()
.AddApplicationPartsIfNotAddedBefore(typeof(MyNewCoreModule).Assembly);
}
}`
The Entity Framework Core project depends on this new module.
[DependsOn( typeof(AbpZeroCoreEntityFrameworkCoreModule), typeof(MyProjectCoreModule), typeof(AbpZeroCoreIdentityServervNextEntityFrameworkCoreModule), typeof(MyNewCoreModule))] public class MyProjectEntityFrameworkCoreModule : AbpModule { }
This last piece of code depends on the MyProjectEntityFrameworkCoreModule.
[DependsOn( typeof(MyProjectApplicationModule), typeof(MyProjectEntityFrameworkCoreModule), typeof(AbpTestBaseModule))] public class MyProjectTestBaseModule : AbpModule { }
What we found strange is that the application runs without any problem, this error only happens on the unit tests.
hi @ismcagdas
Our solution is with the same structure than it is provided when we download aspnetzero. This problem started when we added a new project to the solution. The goal of this project is to connect to another database (it is a class library). This project's module has the following dependencies: AbpEntityFrameworkCoreModule and AbpAspNetCoreModule
We reference this project, on our .Application and .EntityFrameworkCore projects. The module on our .EntityFrameworkCore project depends on the module from our new project.
We did not made any change to the test project neither to its module. If the test module depends on the EntityFrameworkCore module, which in turn, depends on our new project's module, is there something we are missing? Or this issue is not related with the new project?
We created a new project within the solution in order to interact with a second database (which does not contain Identity). We've inherited the Abp framework in this project. The application works as normal when running it.
The problem comes when running the unit tests. The following exception occurs:
There is already a similar issue in this question but does not solve our problem.
What is causing this issue? Some package missing?
Hi @ismcagdas, thanks for your answer.
I've tried but with no success, it returns the same error as before.
Do you have any workaround for this or how do you manage these kind of issues? Do you enter all the subdomains in order to authorize them? This does not sound like a good solution in the long run.
Hello all!
I'm trying to use Google SSO in order to make users login in my application.
I go to https://console.developers.google.com/ , get the ClientId and the ClientSecret and place them in the appsettings.json of the application.
It is a multi-tenant application, so each tenant will have its own subdomain. For instance, client.mydomain.com and client2.mydomain.com.
Since Google does not support wildcards in order to match all the subdomains, how can I achieve a behavior where, regardless of the subdomain used, Google SSO works?
I get this error, if I try to achieve a subdomain that is not in the list of authorized URIs: Erro 400: redirecturimismatch The redirect URI in the request, https://client2.mydomain.com/signin-google, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: https://console.developers.google.com/apis/credentials/oauthclient/${yourclientid}?project=${yourprojectnumber}
Of course, if I put all my subdomains in Google in the authorized URIs it will work, but it is not a good practice to do that everytime a new tenant is added.
How can achieve the behavior?