-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc7e392
commit 441b8e9
Showing
3 changed files
with
9 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,7 +160,7 @@ private Map<String, Object> getUserClaimsInOIDCDialect(OAuthTokenReqMessageConte | |
// Map<(http://wso2.org/claims/email, email), "[email protected]"> | ||
Map<ClaimMapping, String> userAttributes = getCachedUserAttributes(requestMsgCtx); | ||
if (userAttributes.isEmpty() && (isLocalUser(requestMsgCtx.getAuthorizedUser()) | ||
|| isOrganizationSsoUserSwitchingOrganization(requestMsgCtx.getAuthorizedUser()))) { | ||
|| isOrganizationUserSwitchingOrganization(requestMsgCtx.getAuthorizedUser()))) { | ||
if (log.isDebugEnabled()) { | ||
log.debug("User attributes not found in cache against the access token or authorization code. " + | ||
"Retrieving claims for local user: " + requestMsgCtx.getAuthorizedUser() + " from userstore."); | ||
|
@@ -657,16 +657,16 @@ private Map<String, String> getUserClaimsInLocalDialect(String username, | |
} | ||
|
||
/** | ||
* Check whether an organization SSO user is trying to switch the organization. | ||
* Check whether a user managed by an organization is trying to switch to another organization. | ||
* | ||
* @param authorizedUser authorized user from the token request. | ||
* @return true if an organization SSO user is trying to switch the organization. | ||
* @return true if an organization user is trying to switch to another organization. | ||
*/ | ||
private boolean isOrganizationSsoUserSwitchingOrganization(AuthenticatedUser authorizedUser) { | ||
private boolean isOrganizationUserSwitchingOrganization(AuthenticatedUser authorizedUser) { | ||
|
||
/* When accessing organization is different to the resident organization, it means the user is trying to switch | ||
the organization. */ | ||
return authorizedUser.isOrganizationSSOUser() && | ||
/* For an organization user, when accessing organization is different to the resident organization, | ||
it means the user is trying to switch to different organization. */ | ||
return authorizedUser.isOrganizationUser() && | ||
!authorizedUser.getUserResidentOrganization().equals(authorizedUser.getAccessingOrganization()); | ||
} | ||
|
||
|