-
Notifications
You must be signed in to change notification settings - Fork 374
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
Provide support for organization bound tokens for B2B applications #2187
Provide support for organization bound tokens for B2B applications #2187
Conversation
d8a771d
to
e3dc8b2
Compare
...entity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/dao/AuthorizationCodeDAOImpl.java
Show resolved
Hide resolved
PR builder started |
...identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/dao/TokenManagementDAOImpl.java
Show resolved
Hide resolved
.../org/wso2/carbon/identity/oauth2/token/handlers/grant/AbstractAuthorizationGrantHandler.java
Show resolved
Hide resolved
...va/org/wso2/carbon/identity/oauth2/validators/JDBCPermissionBasedInternalScopeValidator.java
Show resolved
Hide resolved
...bon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/dao/AccessTokenDAOImpl.java
Show resolved
Hide resolved
...bon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/dao/AccessTokenDAOImpl.java
Show resolved
Hide resolved
...bon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/dao/AccessTokenDAOImpl.java
Show resolved
Hide resolved
PR builder completed |
PR builder started |
PR builder completed |
PR builder started |
PR builder completed |
There was a problem hiding this 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/6536452532
...bon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/dao/AccessTokenDAOImpl.java
Show resolved
Hide resolved
...bon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/dao/AccessTokenDAOImpl.java
Outdated
Show resolved
Hide resolved
...bon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/dao/AccessTokenDAOImpl.java
Outdated
Show resolved
Hide resolved
String fullQualifiedUsername = authenticatedUser.toFullQualifiedUsername(); | ||
String userTenantDomain = authenticatedUser.getTenantDomain(); | ||
String userResidentTenantDomain = userTenantDomain; | ||
if (StringUtils.isNotEmpty(authenticatedUser.getUserResidentOrganization())) { | ||
userResidentTenantDomain = OAuthComponentServiceHolder.getInstance().getOrganizationManager() | ||
.resolveTenantDomain(authenticatedUser.getUserResidentOrganization()); | ||
} | ||
/* For B2B users, the resident organization is available to find the tenant where the user's identity is | ||
managed. Hence, the correct tenant domain should be used to fetch user claims. */ | ||
if (!StringUtils.equals(userTenantDomain, userResidentTenantDomain)) { | ||
AbstractUserStoreManager userStoreManager = | ||
(AbstractUserStoreManager) OAuthComponentServiceHolder.getInstance().getRealmService() | ||
.getTenantUserRealm(IdentityTenantUtil.getTenantId(userResidentTenantDomain)) | ||
.getUserStoreManager(); | ||
userTenantDomain = userResidentTenantDomain; | ||
fullQualifiedUsername = userStoreManager.getUser(authenticatedUser.getUserId(), null) | ||
.getFullQualifiedUsername(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to check this code is executed for B2B organization login users as they are treated as federated users.
For B2C users with switched to different org won't need this as the user's and app tenant domain remain same.
...s/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/OAuthUtil.java
Outdated
Show resolved
Hide resolved
...bon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/dao/AccessTokenDAOImpl.java
Outdated
Show resolved
Hide resolved
7386f21
to
377c45e
Compare
377c45e
to
43bb4e5
Compare
Proposed changes in this pull request
Add
AUTHORIZED_ORGANIZATION
new column to the IDN_OAUTH2_ACCESS_TOKEN table in order to support organization bound tokens to accomplish B2B IAM use cases.Related Issues.
When should this PR be merged
Depends on