/** * Create a new builder instance. * * @param params Pre-configured oauth parameters. * @param secrets Pre-configured oauth secrets. */ OAuth1BuilderImpl(final OAuth1Parameters params, final OAuth1Secrets secrets) { this(params, secrets, new ConsumerCredentials(params.getConsumerKey(), secrets.getConsumerSecret())); }
String consKey = params.getConsumerKey(); if (consKey == null) { throw new OAuth1Exception(Response.Status.BAD_REQUEST, null);
String consKey = params.getConsumerKey(); if (consKey == null) { throw new OAuth1Exception(Response.Status.BAD_REQUEST, null);
private OAuth1AuthorizationFlowImpl(final OAuth1Parameters params, final OAuth1Secrets secrets, final String requestTokenUri, final String accessTokenUri, final String authorizationUri, final String callbackUri, final Client client, final boolean enableLogging) { this.parameters = params; this.secrets = secrets; this.requestTokenUri = requestTokenUri; this.accessTokenUri = accessTokenUri; this.authorizationUri = authorizationUri; if (client != null) { this.client = client; } else { this.client = ClientBuilder.newBuilder().build(); } final Configuration config = this.client.getConfiguration(); if (enableLogging && !config.isRegistered(LoggingFeature.class)) { this.client.register(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.PAYLOAD_ANY)); } if (!config.isRegistered(OAuth1ClientFeature.class)) { this.client.register(new OAuth1ClientFeature(params, secrets)); } if (callbackUri != null) { this.parameters.callback(callbackUri); } if (secrets.getConsumerSecret() == null || parameters.getConsumerKey() == null) { throw new IllegalStateException(LocalizationMessages.ERROR_CONFIGURATION_MISSING_CONSUMER()); } }
private void checkParametersConsistency(OAuth1Parameters oauth1Parameters, OAuth1Secrets oauth1Secrets) { if (oauth1Parameters.getSignatureMethod() == null) { oauth1Parameters.signatureMethod("HMAC-SHA1"); } if (oauth1Parameters.getVersion() == null) { oauth1Parameters.version(); } if (oauth1Secrets.getConsumerSecret() == null || oauth1Parameters.getConsumerKey() == null) { throw new ProcessingException(LocalizationMessages.ERROR_CONFIGURATION_MISSING_CONSUMER()); } if (oauth1Parameters.getToken() != null && oauth1Secrets.getTokenSecret() == null) { throw new ProcessingException(LocalizationMessages.ERROR_CONFIGURATION_MISSING_TOKEN_SECRET()); } } }
String consumerKey = requiredOAuthParam(params.getConsumerKey()); String token = params.getToken(); String timestamp = requiredOAuthParam(params.getTimestamp());
/** * Create a new builder instance. * * @param params Pre-configured oauth parameters. * @param secrets Pre-configured oauth secrets. */ OAuth1BuilderImpl(final OAuth1Parameters params, final OAuth1Secrets secrets) { this(params, secrets, new ConsumerCredentials(params.getConsumerKey(), secrets.getConsumerSecret())); }
/** * Create a new builder instance. * * @param params Pre-configured oauth parameters. * @param secrets Pre-configured oauth secrets. */ OAuth1BuilderImpl(final OAuth1Parameters params, final OAuth1Secrets secrets) { this(params, secrets, new ConsumerCredentials(params.getConsumerKey(), secrets.getConsumerSecret())); }
/** * Create a new builder instance. * * @param params Pre-configured oauth parameters. * @param secrets Pre-configured oauth secrets. */ OAuth1BuilderImpl(final OAuth1Parameters params, final OAuth1Secrets secrets) { this(params, secrets, new ConsumerCredentials(params.getConsumerKey(), secrets.getConsumerSecret())); }
String consKey = params.getConsumerKey(); if (consKey == null) { throw new OAuth1Exception(Response.Status.BAD_REQUEST, null);
String consKey = params.getConsumerKey(); if (consKey == null) { throw new OAuth1Exception(Response.Status.BAD_REQUEST, null);
String consKey = params.getConsumerKey(); if (consKey == null) { throw new OAuth1Exception(Response.Status.BAD_REQUEST, null);
private OAuth1AuthorizationFlowImpl(final OAuth1Parameters params, final OAuth1Secrets secrets, final String requestTokenUri, final String accessTokenUri, final String authorizationUri, final String callbackUri, final Client client, final boolean enableLogging) { this.parameters = params; this.secrets = secrets; this.requestTokenUri = requestTokenUri; this.accessTokenUri = accessTokenUri; this.authorizationUri = authorizationUri; if (client != null) { this.client = client; } else { this.client = ClientBuilder.newBuilder().build(); } final Configuration config = this.client.getConfiguration(); if (enableLogging && !config.isRegistered(LoggingFeature.class)) { this.client.register(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.PAYLOAD_ANY)); } if (!config.isRegistered(OAuth1ClientFeature.class)) { this.client.register(new OAuth1ClientFeature(params, secrets)); } if (callbackUri != null) { this.parameters.callback(callbackUri); } if (secrets.getConsumerSecret() == null || parameters.getConsumerKey() == null) { throw new IllegalStateException(LocalizationMessages.ERROR_CONFIGURATION_MISSING_CONSUMER()); } }
private OAuth1AuthorizationFlowImpl(final OAuth1Parameters params, final OAuth1Secrets secrets, final String requestTokenUri, final String accessTokenUri, final String authorizationUri, final String callbackUri, final Client client, final boolean enableLogging) { this.parameters = params; this.secrets = secrets; this.requestTokenUri = requestTokenUri; this.accessTokenUri = accessTokenUri; this.authorizationUri = authorizationUri; if (client != null) { this.client = client; } else { this.client = ClientBuilder.newBuilder().build(); } final Configuration config = this.client.getConfiguration(); if (enableLogging && !config.isRegistered(LoggingFilter.class)) { this.client.register(new LoggingFilter(LOGGER, true)); } if (!config.isRegistered(OAuth1ClientFeature.class)) { this.client.register(new OAuth1ClientFeature(params, secrets)); } if (callbackUri != null) { this.parameters.callback(callbackUri); } if (secrets.getConsumerSecret() == null || parameters.getConsumerKey() == null) { throw new IllegalStateException(LocalizationMessages.ERROR_CONFIGURATION_MISSING_CONSUMER()); } }
private void checkParametersConsistency(OAuth1Parameters oauth1Parameters, OAuth1Secrets oauth1Secrets) { if (oauth1Parameters.getSignatureMethod() == null) { oauth1Parameters.signatureMethod("HMAC-SHA1"); } if (oauth1Parameters.getVersion() == null) { oauth1Parameters.version(); } if (oauth1Secrets.getConsumerSecret() == null || oauth1Parameters.getConsumerKey() == null) { throw new ProcessingException(LocalizationMessages.ERROR_CONFIGURATION_MISSING_CONSUMER()); } if (oauth1Parameters.getToken() != null && oauth1Secrets.getTokenSecret() == null) { throw new ProcessingException(LocalizationMessages.ERROR_CONFIGURATION_MISSING_TOKEN_SECRET()); } } }
private OAuth1AuthorizationFlowImpl(final OAuth1Parameters params, final OAuth1Secrets secrets, final String requestTokenUri, final String accessTokenUri, final String authorizationUri, final String callbackUri, final Client client, final boolean enableLogging) { this.parameters = params; this.secrets = secrets; this.requestTokenUri = requestTokenUri; this.accessTokenUri = accessTokenUri; this.authorizationUri = authorizationUri; if (client != null) { this.client = client; } else { this.client = ClientBuilder.newBuilder().build(); } final Configuration config = this.client.getConfiguration(); if (enableLogging && !config.isRegistered(LoggingFilter.class)) { this.client.register(new LoggingFilter(LOGGER, true)); } if (!config.isRegistered(OAuth1ClientFeature.class)) { this.client.register(new OAuth1ClientFeature(params, secrets)); } if (callbackUri != null) { this.parameters.callback(callbackUri); } if (secrets.getConsumerSecret() == null || parameters.getConsumerKey() == null) { throw new IllegalStateException(LocalizationMessages.ERROR_CONFIGURATION_MISSING_CONSUMER()); } }
private void checkParametersConsistency(OAuth1Parameters oauth1Parameters, OAuth1Secrets oauth1Secrets) { if (oauth1Parameters.getSignatureMethod() == null) { oauth1Parameters.signatureMethod("HMAC-SHA1"); } if (oauth1Parameters.getVersion() == null) { oauth1Parameters.version(); } if (oauth1Secrets.getConsumerSecret() == null || oauth1Parameters.getConsumerKey() == null) { throw new ProcessingException(LocalizationMessages.ERROR_CONFIGURATION_MISSING_CONSUMER()); } if (oauth1Parameters.getToken() != null && oauth1Secrets.getTokenSecret() == null) { throw new ProcessingException(LocalizationMessages.ERROR_CONFIGURATION_MISSING_TOKEN_SECRET()); } } }
private void checkParametersConsistency(OAuth1Parameters oauth1Parameters, OAuth1Secrets oauth1Secrets) { if (oauth1Parameters.getSignatureMethod() == null) { oauth1Parameters.signatureMethod("HMAC-SHA1"); } if (oauth1Parameters.getVersion() == null) { oauth1Parameters.version(); } if (oauth1Secrets.getConsumerSecret() == null || oauth1Parameters.getConsumerKey() == null) { throw new ProcessingException(LocalizationMessages.ERROR_CONFIGURATION_MISSING_CONSUMER()); } if (oauth1Parameters.getToken() != null && oauth1Secrets.getTokenSecret() == null) { throw new ProcessingException(LocalizationMessages.ERROR_CONFIGURATION_MISSING_TOKEN_SECRET()); } } }
String consumerKey = requiredOAuthParam(params.getConsumerKey()); String token = params.getToken(); String timestamp = requiredOAuthParam(params.getTimestamp());
String consumerKey = requiredOAuthParam(params.getConsumerKey()); String token = params.getToken(); String timestamp = requiredOAuthParam(params.getTimestamp());