oauthParameters.setOAuthConsumerKey(oauthParams.getOauthConsumerKey()); oauthParameters.setOAuthConsumerSecret(secretKey); oauthParameters.setOAuthNonce(oauthParams.getOauthNonce()); oauthParameters.setOAuthTimestamp(oauthParams.getOauthTimeStamp()); oauthParameters.setOAuthSignatureMethod(oauthParams.getOauthSignatureMethod()); validateTimestampAndNonce(oauthParams.getOauthTimeStamp(), oauthParams.getOauthNonce()); String baseString = OAuthUtil.getSignatureBaseString(oauthParams.getBaseString(), oauthParams.getHttpMethod(), oauthParameters.getBaseParameters()); signature = signer.getSignature(baseString, oauthParameters); } catch (OAuthException e) { && URLEncoder.encode(signature).equals(oauthParams.getOauthSignature())) { return true; } else if (signature != null && signature.equals(oauthParams.getOauthSignature())) { return true;
/** * Checks whether the given consumer is valid or not. This is done by validating the signature, * signed by this particular consumer. * * @param oauthConsumer Parameter related to the OAuth authorization header. * @return * @throws Exception */ public boolean isOAuthConsumerValid(OAuthConsumerDTO oauthConsumer) throws IdentityException { String oAuthSecretKey = getOAuthSecretKey(oauthConsumer.getOauthConsumerKey()); if (oAuthSecretKey == null) { log.debug("Invalid Consumer Key."); throw IdentityException.error("Invalid Consumer Key"); } try { return validateOauthSignature(oauthConsumer, oAuthSecretKey); } catch (AuthenticationException e) { throw IdentityException.error(e.getMessage(), e); } }
/** * Checks whether the given consumer is valid or not. This is done by validating the signature, * signed by this particular consumer. * * @param oauthConsumer Parameter related to the OAuth authorization header. * @return * @throws Exception */ public boolean isOAuthConsumerValid(OAuthConsumerDTO oauthConsumer) throws IdentityException { String oAuthSecretKey = getOAuthSecretKey(oauthConsumer.getOauthConsumerKey()); if (oAuthSecretKey == null) { log.debug("Invalid Consumer Key."); throw IdentityException.error("Invalid Consumer Key"); } try { return validateOauthSignature(oauthConsumer, oAuthSecretKey); } catch (AuthenticationException e) { throw IdentityException.error(e.getMessage(), e); } }
oauthParameters.setOAuthConsumerKey(oauthParams.getOauthConsumerKey()); oauthParameters.setOAuthConsumerSecret(secretKey); oauthParameters.setOAuthNonce(oauthParams.getOauthNonce()); oauthParameters.setOAuthTimestamp(oauthParams.getOauthTimeStamp()); oauthParameters.setOAuthSignatureMethod(oauthParams.getOauthSignatureMethod()); validateTimestampAndNonce(oauthParams.getOauthTimeStamp(), oauthParams.getOauthNonce()); String baseString = OAuthUtil.getSignatureBaseString(oauthParams.getBaseString(), oauthParams.getHttpMethod(), oauthParameters.getBaseParameters()); signature = signer.getSignature(baseString, oauthParameters); } catch (OAuthException e) { && URLEncoder.encode(signature).equals(oauthParams.getOauthSignature())) { return true; } else if (signature != null && signature.equals(oauthParams.getOauthSignature())) { return true;