Open Closed

Invalid token while verifying the email in docker #6433


User avatar
0
uyarbtrlp created
  • ABP Framework version: v7.3.1
  • UI Type: MVC
  • Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..)
  • Tiered (for MVC): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Hello all, We want to send an email confirmation token from Angular app and we want to use MVC keyword(AuthServer confirmation page) for that (not separate Angular UI). Before that, I've wanted to try it on HttpApi.Host. We've added Volo.Abp.Account.Pro.Public.HttpApi dependency in HttpApi module. I am able to see the endpoints on swagger UI After that, when we call the send-email-confirmation-token from the HttpApi.Host, I see that there is empty url in the email. To achieve that problem, I've added the AbpUrlOptions to HttpApi.Host module to set the RoorUrl for "MVC" keyword and give the AuthServer url since email confirmation page is here. Swagger authority is set as AuthServer url. When I try it on my local, everything works fine but it does not work for the docker containers. I get the error invalid token even though the link is correct.

How can I solve that problem?


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    When I try it on my local, everything works fine but it does not work for the docker containers.

    Is the running environment of your docker application Development?

    If so, please Configure the DataProtection to use same keys.

    private void ConfigureDataProtection(
        ServiceConfigurationContext context,
        IConfiguration configuration,
        IWebHostEnvironment hostingEnvironment)
    {
        var dataProtectionBuilder = context.Services.AddDataProtection().SetApplicationName("MyProjectName");
        //if (!hostingEnvironment.IsDevelopment())
        var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!);
        dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "MyProjectName-Protection-Keys");
    }
    
    
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11