/** * Gets the consumer key that the given OAuth request has been authenticated on. * Calling this method on a non-OAuth request will result in {@link IllegalStateException}. * If unsure, simply call {@link #isOAuthRequest(javax.servlet.http.HttpServletRequest)} beforehand. * * @param req the servlet request * @return consumer key * @since 1.6 */ public static String getOAuthConsumerKey(HttpServletRequest req) { checkNotNull(req); checkState(isOAuthRequest(req), "cannot get OAuth consumer key out of non-OAuth request!"); return (String) req.getAttribute(OAUTH_CONSUMER_KEY); }
RequestAnnotations.setOAuthConsumerKey(request, consumer.getKey()); LOG.debug(String.format("3-Legged-OAuth successful. Request marked with consumer key set to [%s]", consumer.getKey()));
markAsOAuthRequest(request); OAuthProblemUtils.logOAuthRequest(request, "OAuth authentication successful. Request marked as OAuth.", LOG);
RequestAnnotations.setOAuthConsumerKey(request, consumer.getKey()); return getUserLoginResult(request, response, message, consumer, user);
public boolean canExecuteRequest(HttpServletRequest request) { return RequestAnnotations.isOAuthRequest(request) || webSudoAuthenticator.isWebSudoSession(request); }