if (oauthToken == null || oauthToken.accessToken == null) {
throw new CloudResourceException(401, "Authentication failed, invalid token");
}
//Set principal to secu context in the request
CloudbeesPrincipal principal = new CloudbeesPrincipalImpl(oauthToken);
return new AuthContainerRequest(principal,request);
}