private OAuth2SpecInfo lookupSpecInfo(final SecurityToken securityToken,
final OAuth2Arguments arguments, final Uri gadgetUri) throws OAuth2RequestException {
log.entering(CLASS, "lookupSpecInfo", new Object[] { securityToken, arguments, gadgetUri });
final GadgetSpec spec = this.findSpec(securityToken, arguments, gadgetUri);
final OAuth2Spec oauthSpec = spec.getModulePrefs().getOAuth2Spec();
if (oauthSpec == null) {
throw new OAuth2RequestException(OAuth2Error.LOOKUP_SPEC_PROBLEM,
"Failed to retrieve OAuth URLs, spec for gadget " + securityToken.getAppUrl()
+ " does not contain OAuth element.", null);
}