abpframework / abp

Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.88k stars 3.44k forks source link

Issue with Admin UI User Permissions context menu option does not work #15284

Closed tobimax closed 1 year ago

tobimax commented 1 year ago

Is there an existing issue for this?

Description

ABP Framework version - ABP CLI 7.0.0-rc.6 User Interface type - Blazor Server / Microservices Template Database provider - EF Core - SLQ Server

Editing user permissions causes and error in the Administration Service.

Reproduction Steps

Go to the user record, rick click and select Permissions, nothing happens and no error message is displayed.

Expected behavior

The same behaviour works if editing permissions on groups.

Actual behavior

Nothing happens in the UI, the following error is written to the Admin Service Logs

2023-01-02 10:25:04.974 +00:00 [INF] Request starting HTTP/1.1 GET https://localhost:44367/api/permission-management/permissions?providerName=U&providerKey=ee2b973b-df52-312d-6ff8-3a08760cd2fd&api-version=1.0 - 0
2023-01-02 10:25:04.976 +00:00 [INF] Executing endpoint 'Volo.Abp.PermissionManagement.PermissionsController.GetAsync (Volo.Abp.PermissionManagement.HttpApi)'
2023-01-02 10:25:04.976 +00:00 [INF] Route matched with {area = "permissionManagement", action = "Get", controller = "Permissions", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Volo.Abp.PermissionManagement.GetPermissionListResultDto] GetAsync(System.String, System.String) on controller Volo.Abp.PermissionManagement.PermissionsController (Volo.Abp.PermissionManagement.HttpApi).
2023-01-02 10:25:04.978 +00:00 [INF] Executing action method Volo.Abp.PermissionManagement.PermissionsController.GetAsync (Volo.Abp.PermissionManagement.HttpApi) - Validation state: "Valid"
2023-01-02 10:25:04.980 +00:00 [DBG] PermissionStore.GetCacheItemAsync: pn:U,pk:399c5136-2a23-ba51-947f-3a0875f7d86b,n:AbpIdentity.Users.ManagePermissions
2023-01-02 10:25:04.989 +00:00 [DBG] Found in the cache: pn:U,pk:399c5136-2a23-ba51-947f-3a0875f7d86b,n:AbpIdentity.Users.ManagePermissions
2023-01-02 10:25:04.989 +00:00 [DBG] PermissionStore.GetCacheItemAsync: pn:R,pk:admin,n:AbpIdentity.Users.ManagePermissions
2023-01-02 10:25:04.994 +00:00 [DBG] Found in the cache: pn:R,pk:admin,n:AbpIdentity.Users.ManagePermissions
2023-01-02 10:25:04.994 +00:00 [DBG] PermissionStore.GetCacheItemAsync: pn:C,pk:BlazorServer,n:AbpIdentity.Users.ManagePermissions
2023-01-02 10:25:05.000 +00:00 [DBG] Found in the cache: pn:C,pk:BlazorServer,n:AbpIdentity.Users.ManagePermissions
2023-01-02 10:25:05.142 +00:00 [INF] Start processing HTTP request POST https://localhost:44322/connect/token
2023-01-02 10:25:05.142 +00:00 [INF] Sending HTTP request POST https://localhost:44322/connect/token
2023-01-02 10:25:05.212 +00:00 [INF] Received HTTP response headers after 70.2379ms - 401
2023-01-02 10:25:05.212 +00:00 [INF] End processing HTTP request after 70.4945ms - 401
2023-01-02 10:25:05.219 +00:00 [ERR] ---------- RemoteServiceErrorInfo ----------
{
  "code": null,
  "message": "An internal error occurred during your request!",
  "details": null,
  "data": {},
  "validationErrors": null
}

2023-01-02 10:25:05.219 +00:00 [ERR] Could not get token from the OpenId Connect server! ErrorType: Http. Error: Unauthorized. ErrorDescription: The specified 'client_id' is invalid.. HttpStatusCode: Unauthorized
Volo.Abp.AbpException: Could not get token from the OpenId Connect server! ErrorType: Http. Error: Unauthorized. ErrorDescription: The specified 'client_id' is invalid.. HttpStatusCode: Unauthorized
   at Volo.Abp.IdentityModel.IdentityModelAuthenticationService.GetAccessTokenAsync(IdentityClientConfiguration configuration)
   at Volo.Abp.IdentityModel.IdentityModelAuthenticationService.GetAccessTokenOrNullAsync(String identityClientName)
   at Volo.Abp.IdentityModel.IdentityModelAuthenticationService.TryAuthenticateAsync(HttpClient client, String identityClientName)
   at Volo.Abp.Http.Client.IdentityModel.IdentityModelRemoteServiceHttpClientAuthenticator.Authenticate(RemoteServiceHttpClientAuthenticateContext context)
   at Volo.Abp.Http.Client.IdentityModel.Web.HttpContextIdentityModelRemoteServiceHttpClientAuthenticator.Authenticate(RemoteServiceHttpClientAuthenticateContext context)
   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.GetRolesAsync(Guid id)
   at Volo.Abp.Identity.HttpClientUserRoleFinder.GetRolesAsync(Guid userId)
   at Volo.Abp.PermissionManagement.Identity.RolePermissionManagementProvider.CheckAsync(String[] names, String providerName, String providerKey)
   at Volo.Abp.PermissionManagement.PermissionManager.GetInternalAsync(PermissionDefinition[] permissions, String providerName, String providerKey)
   at Volo.Abp.PermissionManagement.PermissionManager.GetAsync(String[] permissionNames, String providerName, String providerKey)
   at Volo.Abp.PermissionManagement.PermissionAppService.GetAsync(String providerName, String providerKey)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Auditing.AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, IAuditingHelper auditingHelper, IAuditLogScope auditLogScope)
   at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at lambda_method2245(Closure, Object)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
2023-01-02 10:25:05.219 +00:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'.
2023-01-02 10:25:05.219 +00:00 [INF] Executed action Volo.Abp.PermissionManagement.PermissionsController.GetAsync (Volo.Abp.PermissionManagement.HttpApi) in 243.4998ms
2023-01-02 10:25:05.219 +00:00 [INF] Executed endpoint 'Volo.Abp.PermissionManagement.PermissionsController.GetAsync (Volo.Abp.PermissionManagement.HttpApi)'
2023-01-02 10:25:05.263 +00:00 [DBG] Added 0 entity changes to the current audit log
2023-01-02 10:25:05.264 +00:00 [DBG] Added 0 entity changes to the current audit log
2023-01-02 10:25:05.264 +00:00 [INF] Request finished HTTP/1.1 GET https://localhost:44367/api/permission-management/permissions?providerName=U&providerKey=ee2b973b-df52-312d-6ff8-3a08760cd2fd&api-version=1.0 - 0 - 500 - application/json;+charset=utf-8 289.6386ms

Regression?

N/A

Known Workarounds

No

Version

7.0.0-rc.6

User Interface

Blazor Server

Database Provider

EF Core (Default)

Tiered or separate authentication server

Separate Auth Server

Operation System

Windows (Default)

Other information

No response

realLiangshiwei commented 1 year ago

https://github.com/abpframework/abp/issues/15296#issuecomment-1369311702