Open Closed

OpenId UI pages not loading after migrated from 5.3.2 to 7.2.2 and replaced Identity Server with Openiddict in Blazor WebAssembly of Microservice template #5185


User avatar
0
raju.thinnaluri@gmail.com created

Hi,

We implemented the Blazor WebAssembly app as a SaaS model in microservice template.

Applications Page:

Scopes Page:

And able load the all the services Swagger UI like Admin Service, SaaS Service but Web Gateway Swagger not loading

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

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

36 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Not found

    You can see the web gateway response 404 code, you should check that the gateway is correctly forwarding the request.

    You can create an empty microservice template to compare the gateway project config.

    Swagger:

    You can try :

    Please also add the AbpSwashbuckleModule to the module depends.

  • User Avatar
    0
    raju.thinnaluri@gmail.com created

    Hi,

    Yes, Implemented as per empty sample application. but not working

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Can you share a project that can reproduce the problem with me? shiwei.liang@volosoft.com I will check it.

  • User Avatar
    0
    raju.thinnaluri@gmail.com created

    Hi,

    I uploading the source code and sent a link to your email. please check it.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    1

    2

    You can try replace UseAbpSwaggerUI with UseSwaggerUI

  • User Avatar
    0
    raju.thinnaluri@gmail.com created

    Hi,

    Updated as you suggest, now web gateway swagger loading but still OpenID UI pages not loading.

    should i change anything else?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Can you share the ocelot.json file content?

  • User Avatar
    0
    raju.thinnaluri@gmail.com created

    Can you share the ocelot.json file content?

    Here it is, web gateway ocelot.json

    { "GlobalConfiguration": { "BaseUrl": "https://localhost:44325", "RequestIdKey": "OcRequestId" }, "Routes": [ { "ServiceKey": "Account Service", "DownstreamPathTemplate": "/api/account/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44322 } ], "UpstreamPathTemplate": "/api/account/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "Identity Service", "DownstreamPathTemplate": "/api/identity/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44388 } ], "UpstreamPathTemplate": "/api/identity/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "OpenId Service", "DownstreamPathTemplate": "/api/openiddict/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44388 } ], "UpstreamPathTemplate": "/api/iopeniddict/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "Identity Service", "DownstreamPathTemplate": "/api/account-admin/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44388 } ], "UpstreamPathTemplate": "/api/account-admin/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "Saas Service", "DownstreamPathTemplate": "/api/saas/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44381 } ], "UpstreamPathTemplate": "/api/saas/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "Payment Service", "DownstreamPathTemplate": "/api/payment/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44381 } ], "UpstreamPathTemplate": "/api/payment/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "Administration Service", "DownstreamPathTemplate": "/api/abp/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44367 } ], "UpstreamPathTemplate": "/api/abp/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "Administration Service", "DownstreamPathTemplate": "/api/audit-logging/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44367 } ], "UpstreamPathTemplate": "/api/audit-logging/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "Administration Service", "DownstreamPathTemplate": "/api/language-management/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44367 } ], "UpstreamPathTemplate": "/api/language-management/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "Administration Service", "DownstreamPathTemplate": "/api/text-template-management/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44367 } ], "UpstreamPathTemplate": "/api/text-template-management/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "Administration Service", "DownstreamPathTemplate": "/api/feature-management/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44367 } ], "UpstreamPathTemplate": "/api/feature-management/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "Administration Service", "DownstreamPathTemplate": "/api/permission-management/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44367 } ], "UpstreamPathTemplate": "/api/permission-management/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "Administration Service", "DownstreamPathTemplate": "/api/setting-management/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44367 } ], "UpstreamPathTemplate": "/api/setting-management/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "Administration Service", "DownstreamPathTemplate": "/api/lepton-theme-management/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44367 } ], "UpstreamPathTemplate": "/api/lepton-theme-management/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "Core Service", "DownstreamPathTemplate": "/api/core-service/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44365 } ], "UpstreamPathTemplate": "/api/core-service/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "Messaging Service", "DownstreamPathTemplate": "/api/messaging-service/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44358 } ], "UpstreamPathTemplate": "/api/messaging-service/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "Chat Service", "DownstreamPathTemplate": "/api/chat/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44358 } ], "UpstreamPathTemplate": "/api/chat/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "Signalr Service", "DownstreamPathTemplate": "/signalr-hubs/{everything}", "DownstreamScheme": "wss", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44358 } ], "UpstreamPathTemplate": "/signalr-hubs/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "IT Service", "DownstreamPathTemplate": "/api/i-t-service/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44363 } ], "UpstreamPathTemplate": "/api/i-t-service/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "Report Service", "DownstreamPathTemplate": "/api/report-service/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 45231 } ], "UpstreamPathTemplate": "/api/report-service/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "Document Service", "DownstreamPathTemplate": "/api/document-service/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44478 } ], "UpstreamPathTemplate": "/api/document-service/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "File Management", "DownstreamPathTemplate": "/api/file-management/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44478 } ], "UpstreamPathTemplate": "/api/file-management/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] }, { "ServiceKey": "Work Service", "DownstreamPathTemplate": "/api/work-service/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44371 } ], "UpstreamPathTemplate": "/api/work-service/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] } ]
    }

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    This is a typo: iopeniddict

  • User Avatar
    0
    raju.thinnaluri@gmail.com created

    Hi,

    My bad, typo. after correcting typo the Openid UI pages and web gateway swagger loading.

    but still public web gateway swagger not loading.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Try:

    app.UseSwaggerUI(options =>
    {
    
        var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
        var routes = configuration.GetSection("Routes").Get<List<OcelotConfiguration>>();
        var routedServices = routes
            .GroupBy(t => t.ServiceKey)
            .Select(r => r.First())
            .Distinct();
    
        foreach (var config in routedServices.OrderBy(q => q.ServiceKey))
        {
            if (config.DownstreamHostAndPorts != null && config.DownstreamScheme != "wss")
            {
                var url = $"{config.DownstreamScheme}://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}:{config.DownstreamHostAndPorts.FirstOrDefault()?.Port}";
                if (!env.IsDevelopment())
                {
                    url = $"https://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}";
                }
                options.SwaggerEndpoint($"{url}/swagger/v1/swagger.json", $"{config.ServiceKey} API");
            }
            options.RoutePrefix = string.Empty;
            options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
        }
    });
    
  • User Avatar
    0
    raju.thinnaluri@gmail.com created

    Hi,

    Now both Web Gateway and Public Web gateway Swagger loading.

    but unable to Authorize. getting below issue in both gateways

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    redirect_uri is not valid for client application

    You should check the client application's redirect_uri.

    You can edit the application through OpenId UI

  • User Avatar
    0
    raju.thinnaluri@gmail.com created

    Hi,

    Am able to Authorize in service swagger client.

    but form Web gateway unable to Authorize.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Sorry, I do not quite understand what you mean.

  • User Avatar
    0
    raju.thinnaluri@gmail.com created

    Hi,

    Sorry, I do not quite understand what you mean.

    if i open the Administration Service API with https://localhost:44367/swagger/index.html user able to Authorize

    but same Administration Service API through Web gateway with https://localhost:44325/index.html user unable to Authorize

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    I could not reproduce the problem.

  • User Avatar
    0
    raju.thinnaluri@gmail.com created

    I could not reproduce the problem.

    it is working on https://localhost:44367/swagger/index.html

    please check under https://localhost:44325/index.html

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    I checked https://localhost:44367/swagger/index.html and https://localhost:44325/index.html both.

    This is the https://localhost:44325/index.html

  • User Avatar
    0
    raju.thinnaluri@gmail.com created

    Hi,

    are you running on my source code?

    these are the records in database, is anything missing here?

    is am missing redirect urls?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    are you running on my source code?

    Yes, I used the project you shared.

    these are the records in database, is anything missing here?

    It looks no problem.

    Is there any error log?

    Did you update the redirect_uri?

    For gateway the redirect_uri should be https://localhost:44325/oauth2-redirect.html

  • User Avatar
    0
    raju.thinnaluri@gmail.com created

    No, no changes for redirect urls. No error in logs.

  • User Avatar
    0
    raju.thinnaluri@gmail.com created

    Hi,

    if you want i will share my latest code with you what i have currently.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Unfortunately, I don't know what's happened, can you make a GIF or record a video? Thanks.

    if you want i will share my latest code with you what i have currently.

    Yes, please also share it.

  • User Avatar
    0
    raju.thinnaluri@gmail.com created

    Hi,

    I just shared the source code to shiwei.liang@volosoft.com.

    you can check now.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11