* thrown when the consumer key was not found.
*/
public SecurityToken getSecurityTokenForConsumerRequest(final String consumerKey, final String userId)
throws OAuthProblemException
{
SecurityTokenResponse response = null;
try
{
// Currently, this supports two legged oauth with "reverse call home" where the server hosting an
// application
// wishes to request information about a user that has their application installed on their start page.
ServiceActionContext currentContext = new ServiceActionContext(consumerKey, principalDao.execute(userId));
response = (SecurityTokenResponse) actionController.execute(currentContext,
getSecurityTokenForConsumerRequestAction);
}
catch (Exception ex)
{
logger.error("Error occurred retrieving security token for Consumer Request.", ex);
throw new OAuthProblemException("Error occurred retrieving security token for Consumer Request.");
}
return response != null ? response.getSecurityToken() : null;
}