use of org.wso2.carbon.identity.oauth2.IdentityOAuth2ScopeServerException in project identity-inbound-auth-oauth by wso2-extensions.
the class OAuth2ScopeService method getScopes.
/**
* Retrieve the available scope list.
*
* @param startIndex Start Index of the result set to enforce pagination.
* @param count Number of elements in the result set to enforce pagination.
* @param includeOIDCScopes Include OIDC scopes as well.
* @param requestedScopes Requested set of scopes to be return in the response.
* @param clientId clientId of Oauth app .
* @return Scope list.
*/
public Set<Scope> getScopes(Integer startIndex, Integer count, Boolean includeOIDCScopes, String requestedScopes, String clientId) throws IdentityOAuth2ScopeServerException {
String tenantDomain;
try {
OAuthAppDO oAuthAppDO = OAuth2Util.getAppInformationByClientId(clientId);
tenantDomain = OAuth2Util.getTenantDomainOfOauthApp(oAuthAppDO);
} catch (IdentityOAuth2Exception | InvalidOAuthClientException e) {
log.error("Error while getting oauth app for client Id: " + clientId, e);
throw Oauth2ScopeUtils.generateServerException(Oauth2ScopeConstants.ErrorMessages.ERROR_CODE_FAILED_TO_GET_ALL_SCOPES, e);
}
int tenantId = IdentityTenantUtil.getTenantId(tenantDomain);
return getTenantScopes(startIndex, count, includeOIDCScopes, requestedScopes, tenantId);
}
Aggregations