Open Closed

Microservices template + blazor server UI + azure signalr #2584


User avatar
0
chris.trudel@painworth.com created

Hello,

We are running into an unauthorized errors when we navigate to pages that require calls to authenticated endpoints such as the Users page from the Identity module. We have reduced the replication steps to:

  1. Generate a new microservices-pro solution with a blazor server UI using abp suite v5.1.3.
  2. Configure Azure SignalR as outlined in this support response: https://support.abp.io/QA/Questions/2054/Using-Azure-SignalR-backplane-for-abp-Blazor-app#answer-c0274f93-edd4-7bca-5f27-39fff6ffe2ca
  3. Finish setting up the template/preparing local environment by running etc/dev-cert/create-certificate.ps1 and etc/docker/up.ps1
  4. Start the apps using run-tye.ps1
  5. Navigate to the blazor UI from the tye dashboard
  6. Login as admin
  7. From the menu, click Administration, Identity Management, and then Users
  8. Observe message "No data available" remains, unhandled exceptions in the browser console, UI crashes

Here are some logs from the blazor server app:

`[16:11:31 WRN] Could not find IdentityClientConfiguration for AbpIdentity. Either define a configuration for AbpIdentity or set a default configuration.
[16:11:31 INF] Start processing HTTP request GET https://localhost:44325/api/identity/users/assignable-roles?api-version=1.0
[16:11:31 INF] Sending HTTP request GET https://localhost:44325/api/identity/users/assignable-roles?api-version=1.0
[16:11:31 INF] Received HTTP response headers after 68.6132ms - 401
[16:11:31 INF] End processing HTTP request after 68.7065ms - 401
[16:11:31 WRN] Unhandled exception rendering component: Unauthorized
Volo.Abp.Http.Client.AbpRemoteCallException: Unauthorized
   at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1.ThrowExceptionForResponseAsync(HttpResponseMessage response)
   at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1.RequestAsync(ClientProxyRequestContext requestContext)
   at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1.RequestAsync[T](ClientProxyRequestContext requestContext)
   at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments)
   at Volo.Abp.Identity.ClientProxies.IdentityUserClientProxy.GetAssignableRolesAsync()
   at Volo.Abp.Identity.Pro.Blazor.Pages.Identity.UserManagement.OnInitializedAsync()
   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
[16:11:31 ERR] Unhandled exception in circuit '367ouGPcd8Y1QK8pIIPjkeTSiVhqqC9t3DzqGZ_rpl8'.
Volo.Abp.Http.Client.AbpRemoteCallException: Unauthorized
   at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1.ThrowExceptionForResponseAsync(HttpResponseMessage response)
   at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1.RequestAsync(ClientProxyRequestContext requestContext)
   at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1.RequestAsync[T](ClientProxyRequestContext requestContext)
   at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments)
   at Volo.Abp.Identity.ClientProxies.IdentityUserClientProxy.GetAssignableRolesAsync()
   at Volo.Abp.Identity.Pro.Blazor.Pages.Identity.UserManagement.OnInitializedAsync()
   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)`

Any help would be appreciated.

Thanks, Chris


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

    [16:11:31 INF] Start processing HTTP request GET https://localhost:44325/api/identity/users/assignable-roles?api-version=1.0 [16:11:31 INF] Sending HTTP request GET https://localhost:44325/api/identity/users/assignable-roles?api-version=1.0 [16:11:31 INF] Received HTTP response headers after 68.6132ms - 401

    I think you are overriding the current principle of the user with azure signalr principle that causes 401. Is it only occurs at Users page or other pages like Identity Server Management etc returns 401 as well?

  • User Avatar
    0
    chris.trudel@painworth.com created

    Hello,

    The errors happen for any page, including Identity Server Management, Audit Logs, etc. Just adding Azure SignalR is enough to cause/reproduce the errors, even without the filter to set the principle.

    Thanks,

    Chris

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi chris

    Can you share the project with me? include your Azure SignalR configure. liming.ma@volosoft.com

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