Open Closed

Can't get token after login #9122


User avatar
0
FPT_TuyenDN1 created
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

I'm experiencing an error with the AuthServer service. When I run it in the local environment, everything works fine. However, when I deploy it to the production environment, after logging into the system, I encounter an error where I can't get the token bearer and client redirect to login page. The error log is as follows:

In the DBRAuthServerModule, my code is:

My docker file is:

I don't know why this error occurs. I have checked the configurations in the OpeniddictApplications table and scope. Everything seems correct.


2 Answer(s)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi, the code_verifier parameter is used to have an additional layer of security with PKCE.

    In the production mode, you should generate ProductionEncryptionAndSigningCertificate and it seems you are already doing that, but can you please confirm the xxxx part (password of the certificate) is a real value, and it matches with the password value in your configuration:

    public override void PreConfigureServices(ServiceConfigurationContext context)
    {
        var hostingEnvironment = context.Services.GetHostingEnvironment();
    
        if (!hostingEnvironment.IsDevelopment())
        {
           PreConfigure<AbpOpenIddictAspNetCoreOptions>(options =>
           {
              options.AddDevelopmentEncryptionAndSigningCertificate = false;
           });
    
           PreConfigure<OpenIddictServerBuilder>(serverBuilder =>
           {
               //should match with this 👇
              serverBuilder.AddProductionEncryptionAndSigningCertificate("openiddict.pfx", "xxxx"); 
           });
        }
    }
    

    Also, you can refer to our Configuring OpenIddict documentation for further info.

  • User Avatar
    0
    FPT_TuyenDN1 created

    Sorry, the issue happened because of my mistake. I missed the keyprefix configuration

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on April 16, 2025, 12:13