Skip to content
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

Authorization valve and tenant context valve improvements for support B2B use cases #242

Conversation

sadilchamishka
Copy link
Contributor

@sadilchamishka sadilchamishka commented Sep 13, 2023

Proposed changes in this pull request

As for now, authorization valve validate whether the authenticated user's tenant domain is same as the accessed tenant qualified resource path. If the request is organization qualified, it will be convert to tenant domain to do the mentioned comparison.

With this effort, the tenant qualified URLs and organization qualified URLs are treated separately.

1 - For tenant qualified paths, the previous logic is preserved.

2 - For organization qualified paths, the organization qualified path and the organization where the token is bound should be same. In order to keep the backward compatibility for organization qualified path (there can be tokens without organization bounded tokens to access organization qualified resources), the previous logic [1] is preserved.

[1] - https://github.com/wso2-extensions/identity-carbon-auth-rest/pull/242/files#diff-5c23026718f023a28a31deb8b3b2d38a1d587c41866b829b28ba63c9a72dc91cR104

Also, the organization bound tokens are allowed to be invoked with the root tenant path. When accessing a resources via root tenant URL path with an organization bound token, an organization scoped tenant flow is started to access only the organization scoped resources.

Related Issues.

When should this PR be merged

Depends on

@sadilchamishka sadilchamishka marked this pull request as draft September 13, 2023 12:44
@sadilchamishka sadilchamishka force-pushed the improve-authorization-valve-for-organization-login-users branch from b5394fb to aa26c66 Compare September 22, 2023 13:36
@sadilchamishka sadilchamishka marked this pull request as ready for review September 22, 2023 13:37
@sadilchamishka sadilchamishka changed the title Improve authorization valve based on the new access management Improve authorization valve to validate organization bound tokens Sep 22, 2023
@sadilchamishka sadilchamishka force-pushed the improve-authorization-valve-for-organization-login-users branch from aa26c66 to b39db5a Compare September 22, 2023 13:53
@sadilchamishka sadilchamishka force-pushed the improve-authorization-valve-for-organization-login-users branch 2 times, most recently from 9be3cea to e4dc253 Compare October 17, 2023 03:22
@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/6542213351

@sadilchamishka sadilchamishka changed the title Improve authorization valve to validate organization bound tokens Authorization valve and tenant context valve improvements for support B2B use cases Oct 17, 2023
@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/6542213351
Status: failure

@sadilchamishka sadilchamishka force-pushed the improve-authorization-valve-for-organization-login-users branch from bf2043a to 3e9aff5 Compare October 17, 2023 03:59
@sadilchamishka sadilchamishka force-pushed the improve-authorization-valve-for-organization-login-users branch from 3e9aff5 to c71a43a Compare October 17, 2023 04:02
@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/6542360509

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/6542360509
Status: success

Copy link

@jenkins-is-staging jenkins-is-staging left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/6542360509

@sadilchamishka sadilchamishka merged commit 4e78d64 into wso2-extensions:master Oct 17, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants