Role Based Access Control (RBAC) for the Consent Portal - #81
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Tested with ThunderID (v0.47.0), Asgardeo, Identity Server (implicit), and Auth0 (by Okta) Note: You might need to set BFF_AUTH__ORG_ID_OVERRIDE in env for the Auth0 to work. Make sure you set the correct BFF_AUTH__RESOURCE_AUDIENCE as well |
ae47a3f to
0b0d500
Compare
|
One concern: users with This may allow users to submit any value as Suggested solution: Make There's already an issue for this #51. Will update issues too |
Purpose
Introduce scope-based RBAC for the Consent Portal, expose the authenticated portal session through the BFF, and provide an administrative consent-management view by referring to APIM portals.
Resolves #73, Resolves #77, Resolves #80
Goals
GET /me.VITE_ORG_IDdependency.Approach
The approach is similar to the RBAC in APIM portals. UI elements are hidden depending on the scopes granted to the user. Backend authorization remains authoritative.
Backend
GET /me, returning:userIdorganizationIdBFF_AUTH__ORG_ID_OVERRIDE:BFF_AUTH__ORG_ID_CLAIMbehavior.Frontend
/meAPI, TanStack Query hook, authorization context, route guards, and element guards./meas the portal authentication and authorization authority.VITE_ORG_ID; API requests use the organization resolved by/me.Administrative consents
portal:consents:read:any.portal:consents:write:any.GET /api/consents/{id}and display the result as a single registry row.portal:elements:readis available and free-text fields otherwise.UI screenshots:
User stories
Release note
Added scope-based portal access control, an authenticated
/mesession endpoint, and an administrative consent registry with system-wide search and revoke capabilities.Documentation
Updated:
portal/backend/README.mdportal/backend/docs/README.mdportal/backend/.env.exampleportal/frontend/README.mdportal/frontend/.env.exampleportal/backend/openapi/portal-backend.yamlAutomation tests
/meresponses, scope filtering, placeholder scopes, authentication failures, configuration loading, and organization override behavior./mebehavior.Verification performed:
Security checks
Backend scope enforcement remains the security boundary. Frontend guards provide visibility and navigation control only.
Migrations (if applicable)
VITE_ORG_IDfrom frontend deployment configuration.BFF_AUTH__ORG_ID_CLAIM, or configureBFF_AUTH__ORG_ID_OVERRIDE.BFF_AUTH__ORG_ID_OVERRIDEempty to retain claim-based organization resolution.BFF_PROXY__PLACEHOLDER_SCOPESwhen using local placeholder mode.@wso2/oxygen-ui-icons-reactwas updated.No data or database migration is required.
Test environment
Learning
The implementation follows a BFF-based authorization model:
/me.