Skip to content

Commit

Permalink
Fetch app id in legacy runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaminduR committed Nov 13, 2023
1 parent ff7547b commit 6d3f991
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ public boolean validateGrant(OAuthTokenReqMessageContext tokReqMsgCtx) throws Id
String appResideOrgId = getOrganizationIdFromTenantDomain(authorizedUser.getTenantDomain());
OAuthAppDO oAuthAppDO = (OAuthAppDO) tokReqMsgCtx.getProperty(OAUTH_APP_PROPERTY);
String appName = oAuthAppDO.getApplicationName();
String appId = getAppID(appName, authorizedUser.getTenantDomain());
String appId;
if (CarbonConstants.ENABLE_LEGACY_AUTHZ_RUNTIME && "Console".equalsIgnoreCase(appName)) {
appId = oAuthAppDO.getOauthConsumerKey();
} else {
appId = getAppID(appName, authorizedUser.getTenantDomain());
}
checkOrganizationIsAllowedToSwitch(appResideOrgId, accessingOrgId, appId, appName);

AuthenticatedUser authenticatedUser = new AuthenticatedUser(authorizedUser);
Expand Down

0 comments on commit 6d3f991

Please sign in to comment.