skoruba / Duende.IdentityServer.Admin

The administration for the Duende IdentityServer and Asp.Net Core Identity ⚡
Apache License 2.0
549 stars 194 forks source link

Could not find new Razor page #124

Open apetrut opened 1 year ago

apetrut commented 1 year ago

HI @skoruba ,

I managed to run Admin UI locally using Docker-compose and I added one new UI called Tenants.cshtml.

These are the errors I've got:

skoruba_local_missing_tenants_view

I have checked the folder structure and the view is there:

skoruba_local_vs_view_structure

Important to mention is that using IIS (not Docker) the page loads just fine. Is there another setting that needs to be enabled in order to pick up new views?

Thanks.

skoruba commented 1 year ago

Check csproj, if there is file correctly added.

apetrut commented 1 year ago

I found the lines below in .csproj file (it seems they are automatically added by VS):

error_admin_ui_missing_view

If I remove the first 3 lines the UI stops working. Any ideas here?

skoruba commented 1 year ago

Sure, remove first item group, and keep rest of it.

apetrut commented 1 year ago

I tried that and got the error below:

error_admin_ui_signin_oidc

skoruba commented 1 year ago

that is different error, probable incorrect client secret.

apetrut commented 1 year ago

I haven't changed any client secret recently. Is there any way to get a more detailed error?

skoruba commented 1 year ago

yes, you can check logs in the sts.

apetrut commented 1 year ago

@skoruba the logs look like this and there is no other useful information. I am running your solution using docker-compose.

[2023-02-13T15:24:32.7423852+00:00][INFO][12][Microsoft.AspNetCore.Authorization.DefaultAuthorizationService] Authorization failed. "These requirements were not met:\nRolesAuthorizationRequirement:User.IsInRole must be true for one of the following roles: (MyRole)"
[2023-02-13T15:24:34.0083027+00:00][INFO][12][Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler] AuthenticationScheme: "oidc" was challenged.
"/" Method Call 302 responded 1364.7796 in {6} ms
[2023-02-13T15:24:34.0329889+00:00][INFO][12][Microsoft.AspNetCore.Hosting.Diagnostics] Request finished HTTP/1.1 GET http://admin.skoruba.local/ - - - 302 0 - 1408.5986ms
[2023-02-13T15:25:16.6913638+00:00][INFO][23][Microsoft.AspNetCore.Hosting.Diagnostics] Request starting HTTP/1.1 POST http://admin.skoruba.local/signin-oidc application/x-www-form-urlencoded 627
[2023-02-13T15:25:16.8081150+00:00][EROR][23][Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler] Message contains error: '"invalid_request"', error_description: '"error_description is null"', error_uri: '"error_uri is null"', status code '400'.
[2023-02-13T15:25:46.4423613+00:00][EROR][23][Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler] Exception occurred while processing message.
Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolException: Message contains error: 'invalid_request', error_description: 'error_description is null', error_uri: 'error_uri is null'.
   at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.RedeemAuthorizationCodeAsync(OpenIdConnectMessage tokenEndpointRequest)
   at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.HandleRemoteAuthenticateAsync()
[2023-02-13T15:25:46.4472785+00:00][INFO][23][Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler] Error from RemoteAuthentication: "Message contains error: 'invalid_request', error_description: 'error_description is null', error_uri: 'error_uri is null'.".

I checked and the user has the role "myRole" assigned.

image

apetrut commented 1 year ago

that is different error, probable incorrect client secret.

@skoruba where can I change the client secret from and what value will work?

apetrut commented 1 year ago

@skoruba,

Do you have any updated on this issue?

These requirements were not met:\nRolesAuthorizationRequirement:User.IsInRole must be true for one of the following roles: (MyRole)