Open Closed

How to disable https in openiddict #3816


User avatar
0
lizhaofeng created

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, please use the search on the homepage.

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v6.0.0
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

At present, it is used in the internal environment, enable https for some system modifications is too large, how to disable https


6 Answer(s)
  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    Serve your authserver under HTTP (without HTTPS redirection).

    Confirm you have HTTP issuer under .well-known/openid-configuration endpoint.

    Update your application's appsettings AuthServer section and set RequireHttpsMetadata to false.

  • User Avatar
    0
    lizhaofeng created

    Serve your authserver under HTTP (without HTTPS redirection).

    Confirm you have HTTP issuer under .well-known/openid-configuration endpoint.

    Update your application's appsettings AuthServer section and set RequireHttpsMetadata to false.

    Hi gterdem

    Following the above practices was not successful, the following are error messages

    error:invalid_request error_description:This server only accepts HTTPS requests. error_uri:https://documentation.openiddict.com/errors/ID2083

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    Try

    PreConfigure<OpenIddictServerAspNetCoreBuilder>(configure =>
    {
        configure.DisableTransportSecurityRequirement();
    });
    

    In your AuthServer PreConfigureServices method.

  • User Avatar
    0
    lizhaofeng created

    Hi,gterdem

    I've tried to use instead of , but unfortunately with the same result.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you try to use Configure?

    Configure<OpenIddictServerAspNetCoreBuilder>(configure =>
    {
        configure.DisableTransportSecurityRequirement();
    });
    
  • User Avatar
    0
    lizhaofeng created

    hi maliming

    It didn't work.

    Can you try to use Configure?

    Configure<OpenIddictServerAspNetCoreBuilder>(configure => 
    { 
        configure.DisableTransportSecurityRequirement(); 
    }); 
    

    After trying to add the following configuration, it works.

    Configure(options => { options.DisableTransportSecurityRequirement = true; });

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38