Open Closed

Separate report application same authentication SSO? #4922


User avatar
0
pablo@ccalp.net created
  • ABP Framework version: v7.0.x
  • UI type: Angular
  • DB provider: EF Core

Need guidance on the following: I need to create a separate application for report processing but need to be able to authenticate and read the claims of the user requesting the reports using the same credentials from the application to be able to know the tenantid and connect to the right database. The reports will be displayed in the angular application in an iframe.


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

    Hi,

    The report application can be used as an API service.

    You can check this: https://docs.abp.io/en/commercial/latest/startup-templates/microservice/add-microservice#authserver-configuration

  • User Avatar
    0
    pablo@ccalp.net created

    Will this work if I'm not using a microservice architecture?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Yes, you also need to configure authentication in the service

    For example:

    private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration)
    {
        context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
            .AddJwtBearer(options =>
            {
                options.Authority = configuration["AuthServer:Authority"];
                options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]);
                options.Audience = "ReportService";
            });
    }
    
  • User Avatar
    0
    pablo@ccalp.net created

    Trying to create the service as suggested but getting an error that says: Could not find a part of the path 'C:\Repos\CompuCare\aspnet-core\apps\auth-server'.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I don't mean to follow the docs exactly, I mean only the authorization server configuration section.

    In your project, should be .Domain\OpenIddict\OpenIddictDataSeedContributor

  • User Avatar
    0
    pablo@ccalp.net created

    I think I figured it out, thank you. Would I take the same approach to host a Hangfire server independently from the main API?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    hangfire can run in distributed and cluster environments, you can configure the same or different connection strings for it.

    If you want all services to use hangfire, you need to install for them all

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11