-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenID application with the Administrator role isn't authorized for all permissions anymore #17083
Comments
@kevinchalet I'll try to look into this in the morning, but do we handle permissions check using OpenId implementation different that what we do in OC? With the latest update, we don't store permission claims when a user with Administrator role logs in. In an Authorization handler we added this check OrchardCore/src/OrchardCore.Modules/OrchardCore.Settings/Services/SuperUserHandler.cs Line 28 in 2355c10
When an Admin user logs in we grant them this Owner permission OrchardCore/src/OrchardCore.Modules/OrchardCore.Roles/Services/RoleClaimsProvider.cs Line 40 in 2355c10
I don't think OpenId does anything different and handler permission just like we do in other places |
No. The issue described here is likely caused by the fact we're not injecting that new special claim for the client credentials grant, which is a user-less flow but for which we nevertheless allow attaching "role claims" to the access token as a way to control permissions: OrchardCore/src/OrchardCore.Modules/OrchardCore.OpenId/Controllers/AccessController.cs Lines 454 to 471 in 2355c10
Now... it's not clear to me why this "site owner" has a special treatment and isn't exposed as a regular role... |
Describe the bug
When an OpendID application is configured for the Administrator Client Credentials Role, it's not authorizing as if it had all the permissions and thus authorization fails.
I suspect this is coming from #16781 @MikeAlhayek.
Orchard Core version
v2.1.1 but latest
main
too.To Reproduce
Program
to your OC instance's. For your convenience, I'm including a Windows executable below, configured for the vanilla OC frommain
(just runLombiq.OrchardCoreApiClient.Tester.exe
from the CLI). This app accesses the OC tenant and content management APIs.This is because this authorization fails, what you can also observe from the debugger:
OrchardCore/src/OrchardCore.Modules/OrchardCore.Tenants/Controllers/TenantApiController.cs
Line 92 in 2355c10
The executable:
net8.0.zip
If you instead use a role that explicitly has the Manage Tenants permission, then the authorization works.
Expected behavior
The API authorization, and thus tenant creation, continues to work with the Administrator role.
Logs and screenshots
The text was updated successfully, but these errors were encountered: