Activities of "abpnewtonvisionco"

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?

So, after debugging I see that the code gets here when the user clicks on the link:

However, the "EmailConfirmed" is always false, maybe we are missing something there?

Hi,

The position looks like no problem, have you added this attrubute?

[Dependency(ReplaceServices = true)]  
[ExposeServices(typeof(AccountAppService))] 
[Dependency(ReplaceServices = true)]  
[ExposeServices(typeof(EmailConfirmationModel))]  

Hi Liang, Yes. I added that on top of both classes:

Hi,

You can override the AccountAppService and EmailConfirmation

 
[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,

  • ABP Framework version: v7.2.2
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): Auth Server separated

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

Hello abpnewtonvisionco,

Please confirm on this, are you using localization at front end as shown in screenshot

if you missed that :: before Menu like

then it gives result like

Regards,

Hi, this is how we are doing it.

this is the json file:

and this is how it looks in the application:

  • ABP Framework version: v7.2.2
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • **Tiered (for MVC) : yes

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:

  • ABP Framework version: v7.2.2
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): Tiered
  • Exception message and full stack trace:

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.&lt;&gt;c__DisplayClass14_0.&lt;UseSingleConstructorActivation&gt;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.&lt;&gt;c__DisplayClass14_0.&lt;BuildPipeline&gt;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.&lt;&gt;c__DisplayClass14_0.&lt;BuildPipeline&gt;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?

Showing 11 to 20 of 35 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on December 26, 2024, 06:07