Hi,
I guess the user's email address was not confirmed, but there was a problem when confirming the email address.
Please share it with email: shiwei.liang@volosoft.com
Thanks.
Hi Liang,
Done. I sent them to you.
Hi,
Sure, I have them with the app insight telemetry, can I send you those or you want them in a specific way?
Hi,
You can override the
AccountAppService
andEmailConfirmation
[Dependency(ReplaceServices = true)] [ExposeServices(typeof(AccountAppService))] public class MyAccountAppService : AccountAppService { .... public override async Task ConfirmEmailAsync(ConfirmEmailInput input) { var user = await UserManager.GetByIdAsync(input.UserId); if (user.EmailConfirmed) { return; } (await UserManager.ConfirmEmailAsync(user, input.Token)).CheckErrors(); (await UserManager.UpdateSecurityStampAsync(user)).CheckErrors(); await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext { Identity = IdentitySecurityLogIdentityConsts.Identity, Action = IdentitySecurityLogActionConsts.ChangeEmail }); } }
[Dependency(ReplaceServices = true)] [ExposeServices(typeof(EmailConfirmationModel))] public class MyEmailConfirmationModel : EmailConfirmationModel { ... public override async Task<IActionResult> OnGetAsync() { ReturnUrl = GetRedirectUrl(ReturnUrl, ReturnUrlHash); try { var user = await UserManager.GetByIdAsync(UserId); if (user.EmailConfirmed) { EmailConfirmed = true; return Page(); } ValidateModel(); InvalidToken = !await AccountAppService.VerifyEmailConfirmationTokenAsync( new VerifyEmailConfirmationTokenInput() { UserId = UserId, Token = ConfirmationToken } ); if (!InvalidToken) { await _accountAppService.ConfirmEmailAsync(new ConfirmEmailInput { UserId = UserId, Token = ConfirmationToken }); EmailConfirmed = true; } } catch (Exception e) { if (e is AbpIdentityResultException && !string.IsNullOrWhiteSpace(e.Message)) { Alerts.Warning(GetLocalizeExceptionMessage(e)); return Page(); } if (e is AbpValidationException) { return Page(); } throw; } return Page(); } }
Hi Liang, thanks for the answer. I replaced the ConfirmEmail by adding a "CustomEmailConfirmation" Page under /Pages/Account/CustomEmailConfirmationModel.html and CustomEmailConfirmationModel.cs
I am not sure for the "AppService". I added it under the same /Pages/Account and just a class with the code you sent.
I added these changes and the Token that I get on the email still shows as invalid
Am I adding in the wrong section the override for the "AppService"?
Here it is how I added it:
Regards,
Hey Team,
Currently we are facing an issue when the user uses the registration and the confirmation email setting is on, the user gets the email for him to confirm hisaccount but he gets an "Invalid Token" error in the EmailConfirmation page.
I've seen in the forum that this is an issue in this current version that we are using (7.2.2) and that was fixed somewhere in 7.3. Is there a way for us to fix this issue in the current version? Is there a way to override the EmailConfirmation page? I tried adding it in the /Pages/Account/EmailConfirmation but throws an error saying that it already exist in the project.
How can we fix this issue?
I've seen that this is kind of the fix but not entirely sure how to implement it: https://support.abp.io/QA/Questions/5422/Customize-email-confirmation-token-after-successfully-confirm-email
Regards
Hi guys, hope you are doing well.
We have been experiencing issues regarding the Localization feature, it takes a very long time until it actually takes the value to display it in the front end. (Our system is quite large now) I reviewed some of the posts regarding Localization issues (i.e. https://support.abp.io/QA/Questions/5794/Localization-is-not-working-on-my-Microservice) so it is not particularly something that we are doing wrong as we are using the feature as it is mentioned in the documentation.
Obviously we tried what is recommended like clear Redis Cache, or try in another browser, or re start the appservice. Even we went far to test it to re create the administration db.
This is affecting the cloud environments
Is there something that we can do about this?
Thanks team
Note: There are no logs for this as it is not an error perse, it just takes a very long time until the localization renders the information saved in the Json
(With it takes very long time, its not the loading the name in the page but it takes several days for it to actually "take" or "recognize" that it has the proper configuration)
Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, and please first use the search on the homepage. Provide us with the following info:
OurAuthServerurl.com/connect/authorize?response_type=code&client_id=PilotWebApp&state=RlVSVURvNWRnRFNJZEo1Y3cycXVfZnZKUnpaQ3lMWjVtZWZnVEVSVDhlUzBh&redirect_uri=https%3A%2F%2Fflyguys-pilots-dev-cus.azurewebsites.net%2F&scope=offline_access%20openid%20profile%20email%20phone%20AccountService%20IdentityService%20AdministrationService%20SaasService%20ProductService%20CoreService%20FileManagementService%20FGChatService%20NotificationService%20missionsService%20customersService%20pilotsService%20qAQCService&code_challenge=fFYnV_f7ryuIPjKF5PBvuVzAyL5fIEXK2X5Oz-hikTc&code_challenge_method=S256&nonce=RlVSVURvNWRnRFNJZEo1Y3cycXVfZnZKUnpaQ3lMWjVtZWZnVEVSVDhlUzBh&culture=en&ui-culture=en
Hey guys,
We added the code flow log in for the application and we are getting an issue,
Payload:
response_type: code client_id: PilotWebApp state: RlVSVURvNWRnRFNJZEo1Y3cycXVfZnZKUnpaQ3lMWjVtZWZnVEVSVDhlUzBh redirect_uri: AngularWebAppUrl.com scope: offline_access openid profile email phone AccountService IdentityService AdministrationService SaasService ProductService CoreService FileManagementService FGChatService NotificationService missionsService customersService pilotsService qAQCService code_challenge: fFYnV_f7ryuIPjKF5PBvuVzAyL5fIEXK2X5Oz-hikTc code_challenge_method: S256 nonce: RlVSVURvNWRnRFNJZEo1Y3cycXVfZnZKUnpaQ3lMWjVtZWZnVEVSVDhlUzBh culture: en ui-culture: en
what is weird about is that in localhost it is working correctly, but when we move the changes up to an environment in Azure it is throwing that issue (the 302) followed with this one:
Do we need an specific change for the web apps in azure? We have them in docker images that are hosted in Web app Containers, everything works correctly except the log in. Also not sure as this works as expected in localhost.
Let me know if I need to send more information!
maybe is a question that has a private mode?
Yes you are right.
The answer detail is :
hi
You can add cookies authentication to your API website. Issue cookies after appropriate verification.
After that,
AbpHangfireAuthorizationFilter
will work on the API website.public class HomeController : AbpController { public async Task<ActionResult> Index(string username, string password) { if (username == "admin" && password == "1q2w3E*") { var user = await HttpContext.RequestServices.GetRequiredService<IdentityUserManager>().FindByNameAsync(username); var userClaimsPrincipalFactory = HttpContext.RequestServices.GetRequiredService<IUserClaimsPrincipalFactory<Volo.Abp.Identity.IdentityUser>>(); await HttpContext.SignInAsync("HangFireCookie", await userClaimsPrincipalFactory.CreateAsync(user!)); } return Redirect("~/swagger"); } }
Depends On typeof(AbpIdentityAspNetCoreModule)
<ProjectReference Include="..\..\..\..\..\..\..\abp\modules\identity\src\Volo.Abp.Identity.AspNetCore\Volo.Abp.Identity.AspNetCore.csproj" />
context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(options => { options.Authority = configuration["AuthServer:Authority"]; options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]); options.Audience = "_3M"; }) .AddCookie("HangFireCookie", options => { options.ExpireTimeSpan = TimeSpan.FromHours(2); });
app.UseAuthentication(); app.Use(async (ctx, next) => { if (ctx.User.Identity?.IsAuthenticated != true) { var result = await ctx.AuthenticateAsync("HangFireCookie"); if (result.Succeeded && result.Principal != null) { ctx.User = result.Principal; } } await next(); }); if (MultiTenancyConsts.IsEnabled) { app.UseMultiTenancy(); } app.UseAuthorization();
Thanks for the answer Lian,
I added these changes however when I hit this controller I am getting an error when resolving the "GetRequiredService":
Autofac.Core.DependencyResolutionException: An exception was thrown while activating Castle.Proxies.IdentityUserManagerProxy.
---> Autofac.Core.DependencyResolutionException: None of the constructors found on type 'Castle.Proxies.IdentityUserManagerProxy' can be invoked with the available services and parameters:
Cannot resolve parameter 'Volo.Abp.Identity.IIdentityRoleRepository roleRepository' of constructor 'Void .ctor(Castle.DynamicProxy.IInterceptor[], Volo.Abp.Identity.IdentityUserStore, Volo.Abp.Identity.IIdentityRoleRepository, Volo.Abp.Identity.IIdentityUserRepository, Microsoft.Extensions.Options.IOptions`1[Microsoft.AspNetCore.Identity.IdentityOptions], Microsoft.AspNetCore.Identity.IPasswordHasher`1[Volo.Abp.Identity.IdentityUser], System.Collections.Generic.IEnumerable`1[Microsoft.AspNetCore.Identity.IUserValidator`1[Volo.Abp.Identity.IdentityUser]], System.Collections.Generic.IEnumerable`1[Microsoft.AspNetCore.Identity.IPasswordValidator`1[Volo.Abp.Identity.IdentityUser]], Microsoft.AspNetCore.Identity.ILookupNormalizer, Microsoft.AspNetCore.Identity.IdentityErrorDescriber, System.IServiceProvider, Microsoft.Extensions.Logging.ILogger`1[Volo.Abp.Identity.IdentityUserManager], Volo.Abp.Threading.ICancellationTokenProvider, Volo.Abp.Identity.IOrganizationUnitRepository, Volo.Abp.Settings.ISettingProvider)'.
See https://autofac.rtfd.io/help/no-constructors-bindable for more info.
at Autofac.Core.Activators.Reflection.ReflectionActivator.<>c__DisplayClass14_0.<UseSingleConstructorActivation>b__0(ResolveRequestContext ctxt, Action`1 next)
at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt)
at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt)
at Autofac.Builder.RegistrationBuilder`3.<>c__DisplayClass41_0.<PropertiesAutowired>b__0(ResolveRequestContext ctxt, Action`1 next)
at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt)
at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
Let me add screenshots on how my HttpApiHostModule looks:
I am wondering if its because a wrong using that I have on the controller?