use of org.wso2.carbon.identity.oauth2.stub.dto.OAuth2TokenValidationRequestDTO in project airavata by apache.
the class DefaultOAuthClient method validateAccessToken.
/**
* Validates the OAuth 2.0 access token
*
* @param accessToken
* @return
* @throws Exception
*/
public OAuth2TokenValidationResponseDTO validateAccessToken(String accessToken) throws AiravataSecurityException {
try {
OAuth2TokenValidationRequestDTO oauthReq = new OAuth2TokenValidationRequestDTO();
OAuth2TokenValidationRequestDTO_OAuth2AccessToken token = new OAuth2TokenValidationRequestDTO_OAuth2AccessToken();
token.setIdentifier(accessToken);
token.setTokenType(BEARER_TOKEN_TYPE);
oauthReq.setAccessToken(token);
return stub.validate(oauthReq);
} catch (RemoteException e) {
logger.error(e.getMessage(), e);
throw new AiravataSecurityException("Error in validating the OAuth access token.");
}
}
Aggregations