public OAuth1(String consumerKey, String consumerSecret, String token, String tokenSecret) { this.consumerKey = Preconditions.checkNotNull(consumerKey); this.consumerSecret = Preconditions.checkNotNull(consumerSecret); this.token = Preconditions.checkNotNull(token); this.tokenSecret = Preconditions.checkNotNull(tokenSecret); this.normalizer = Normalizer.getStandardNormalizer(); this.signer = Signer.getStandardSigner(); this.secureRandom = new SecureRandom(); }
String normalized = normalizer.normalize( request.getURI().getScheme(), request.getURI().getHost(), port, request.getMethod().toUpperCase(), request.getURI().getPath(), javaParams, oAuth1Params
String normalized = this.normalizer.normalize(requestUri.getScheme(), requestUri.getHost(), port, httpMethod.name().toUpperCase(), requestUri.getPath(), requestParams, oAuth1Params);
public static StandardUnpacker newUnpacker() { return new StandardUnpacker( OAuthParams.STANDARD_OAUTH_PARAMS_HELPER, Normalizer.getStandardNormalizer(), KeyValueParser.QueryKeyValueParser, KeyValueParser.HeaderKeyValueParser ); }
public String normalize(Request.ParsedRequest req, OAuthParams.OAuth1Params oAuth1Params) { return normalize( req.scheme(), req.host(), req.port(), req.verb(), req.path(), req.params(), oAuth1Params ); }
public static StandardUnpacker newUnpacker(OAuthParams.OAuthParamsHelper helper) { return new StandardUnpacker( helper, Normalizer.getStandardNormalizer(), KeyValueParser.QueryKeyValueParser, KeyValueParser.HeaderKeyValueParser ); } }
public OAuth1TwoLeggedRequest buildOAuth1TwoLeggedRequest( Request.ParsedRequest parsedRequest, OAuthParams.OAuth1Params oAuth1Params, Normalizer normalize ) throws MalformedRequest, UnsupportedEncodingException { verify(parsedRequest, oAuth1Params); return new OAuth1TwoLeggedRequest( UrlCodec.decode(oAuth1Params.consumerKey()), UrlCodec.decode(oAuth1Params.nonce()), oAuth1Params.timestampSecs(), oAuth1Params.signature(), oAuth1Params.signatureMethod(), oAuth1Params.version(), parsedRequest, normalize.normalize(parsedRequest, oAuth1Params) ); } }
@Autowired public TwitterOAuth(TwitterProperties twitterProps) { this.consumerKey = twitterProps.getConsumerKey(); this.consumerSecret = twitterProps.getConsumerSecret(); this.token = twitterProps.getToken(); this.tokenSecret = twitterProps.getSecret(); this.normalizer = Normalizer.getStandardNormalizer(); this.signer = Signer.getStandardSigner(); this.secureRandom = new SecureRandom(); }
public OAuth1Request buildOAuth1Request( Request.ParsedRequest parsedRequest, OAuthParams.OAuth1Params oAuth1Params, Normalizer normalize ) throws MalformedRequest, UnsupportedEncodingException { verify(parsedRequest, oAuth1Params); return new OAuth1Request( UrlCodec.decode(oAuth1Params.token()), // should never be called when token is None UrlCodec.decode(oAuth1Params.consumerKey()), UrlCodec.decode(oAuth1Params.nonce()), oAuth1Params.timestampSecs(), oAuth1Params.signature(), oAuth1Params.signatureMethod(), oAuth1Params.version(), parsedRequest, normalize.normalize(parsedRequest, oAuth1Params) ); }