/** * Create a OAuth2Auth provider for Salesforce * * @param clientId the client id given to you by Salesforce * @param clientSecret the client secret given to you by Salesforce */ static OAuth2Auth create(Vertx vertx, String clientId, String clientSecret) { return create(vertx, clientId, clientSecret, new HttpClientOptions()); }
/** * Create a OAuth2Auth provider for OpenID Connect Discovery. The discovery will use the default site in the * configuration options and attempt to load the well known descriptor. If a site is provided (for example when * running on a custom instance) that site will be used to do the lookup. * <p> * If the discovered config includes a json web key url, it will be also fetched and the JWKs will be loaded * into the OAuth provider so tokens can be decoded. * @param vertx the vertx instance * @param config the initial config * @param handler the instantiated Oauth2 provider instance handler */ public static void discover(io.vertx.rxjava.core.Vertx vertx, OAuth2ClientOptions config, Handler<AsyncResult<io.vertx.rxjava.ext.auth.oauth2.OAuth2Auth>> handler) { io.vertx.ext.auth.oauth2.providers.SalesforceAuth.discover(vertx.getDelegate(), config, new Handler<AsyncResult<io.vertx.ext.auth.oauth2.OAuth2Auth>>() { public void handle(AsyncResult<io.vertx.ext.auth.oauth2.OAuth2Auth> ar) { if (ar.succeeded()) { handler.handle(io.vertx.core.Future.succeededFuture(io.vertx.rxjava.ext.auth.oauth2.OAuth2Auth.newInstance(ar.result()))); } else { handler.handle(io.vertx.core.Future.failedFuture(ar.cause())); } } }); }
/** * Create a OAuth2Auth provider for Salesforce * @param vertx * @param clientId the client id given to you by Salesforce * @param clientSecret the client secret given to you by Salesforce * @return */ public static io.vertx.rxjava.ext.auth.oauth2.OAuth2Auth create(io.vertx.rxjava.core.Vertx vertx, String clientId, String clientSecret) { io.vertx.rxjava.ext.auth.oauth2.OAuth2Auth ret = io.vertx.rxjava.ext.auth.oauth2.OAuth2Auth.newInstance(io.vertx.ext.auth.oauth2.providers.SalesforceAuth.create(vertx.getDelegate(), clientId, clientSecret)); return ret; }
/** * Create a OAuth2Auth provider for OpenID Connect Discovery. The discovery will use the default site in the * configuration options and attempt to load the well known descriptor. If a site is provided (for example when * running on a custom instance) that site will be used to do the lookup. * <p> * If the discovered config includes a json web key url, it will be also fetched and the JWKs will be loaded * into the OAuth provider so tokens can be decoded. * @param vertx the vertx instance * @param config the initial config * @param handler the instantiated Oauth2 provider instance handler */ public static void discover(io.vertx.rxjava.core.Vertx vertx, OAuth2ClientOptions config, Handler<AsyncResult<io.vertx.rxjava.ext.auth.oauth2.OAuth2Auth>> handler) { io.vertx.ext.auth.oauth2.providers.SalesforceAuth.discover(vertx.getDelegate(), config, new Handler<AsyncResult<io.vertx.ext.auth.oauth2.OAuth2Auth>>() { public void handle(AsyncResult<io.vertx.ext.auth.oauth2.OAuth2Auth> ar) { if (ar.succeeded()) { handler.handle(io.vertx.core.Future.succeededFuture(io.vertx.rxjava.ext.auth.oauth2.OAuth2Auth.newInstance(ar.result()))); } else { handler.handle(io.vertx.core.Future.failedFuture(ar.cause())); } } }); }
/** * Create a OAuth2Auth provider for Salesforce * @param vertx * @param clientId the client id given to you by Salesforce * @param clientSecret the client secret given to you by Salesforce * @return */ public static io.vertx.rxjava.ext.auth.oauth2.OAuth2Auth create(io.vertx.rxjava.core.Vertx vertx, String clientId, String clientSecret) { io.vertx.rxjava.ext.auth.oauth2.OAuth2Auth ret = io.vertx.rxjava.ext.auth.oauth2.OAuth2Auth.newInstance(io.vertx.ext.auth.oauth2.providers.SalesforceAuth.create(vertx.getDelegate(), clientId, clientSecret)); return ret; }
public static void discover(io.vertx.ext.auth.oauth2.providers.SalesforceAuth j_receiver, io.vertx.core.Vertx vertx, java.util.Map<String, Object> config, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.auth.oauth2.OAuth2Auth>> handler) { io.vertx.ext.auth.oauth2.providers.SalesforceAuth.discover(vertx, config != null ? new io.vertx.ext.auth.oauth2.OAuth2ClientOptions(io.vertx.core.impl.ConversionHelper.toJsonObject(config)) : null, handler != null ? new io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.auth.oauth2.OAuth2Auth>>() { public void handle(io.vertx.core.AsyncResult<io.vertx.ext.auth.oauth2.OAuth2Auth> ar) { handler.handle(ar.map(event -> io.vertx.core.impl.ConversionHelper.fromObject(event))); } } : null); } }
/** * Create a OAuth2Auth provider for Salesforce * @param vertx * @param clientId the client id given to you by Salesforce * @param clientSecret the client secret given to you by Salesforce * @param httpClientOptions custom http client options * @return */ public static io.vertx.rxjava.ext.auth.oauth2.OAuth2Auth create(io.vertx.rxjava.core.Vertx vertx, String clientId, String clientSecret, HttpClientOptions httpClientOptions) { io.vertx.rxjava.ext.auth.oauth2.OAuth2Auth ret = io.vertx.rxjava.ext.auth.oauth2.OAuth2Auth.newInstance(io.vertx.ext.auth.oauth2.providers.SalesforceAuth.create(vertx.getDelegate(), clientId, clientSecret, httpClientOptions)); return ret; }
@Test public void testSalesforce() { SalesforceAuth.discover(vertx, new OAuth2ClientOptions(), load -> { // will fail as there is no application config, but the parsing should have happened assertTrue(load.failed()); assertEquals("Configuration missing. You need to specify [clientId]", load.cause().getMessage()); testComplete(); }); await(); } }
/** * Create a OAuth2Auth provider for Salesforce * @param vertx * @param clientId the client id given to you by Salesforce * @param clientSecret the client secret given to you by Salesforce * @param httpClientOptions custom http client options * @return */ public static io.vertx.rxjava.ext.auth.oauth2.OAuth2Auth create(io.vertx.rxjava.core.Vertx vertx, String clientId, String clientSecret, HttpClientOptions httpClientOptions) { io.vertx.rxjava.ext.auth.oauth2.OAuth2Auth ret = io.vertx.rxjava.ext.auth.oauth2.OAuth2Auth.newInstance(io.vertx.ext.auth.oauth2.providers.SalesforceAuth.create(vertx.getDelegate(), clientId, clientSecret, httpClientOptions)); return ret; }
public static io.vertx.ext.auth.oauth2.OAuth2Auth create(io.vertx.ext.auth.oauth2.providers.SalesforceAuth j_receiver, io.vertx.core.Vertx vertx, java.lang.String clientId, java.lang.String clientSecret, java.util.Map<String, Object> httpClientOptions) { return io.vertx.core.impl.ConversionHelper.fromObject(io.vertx.ext.auth.oauth2.providers.SalesforceAuth.create(vertx, clientId, clientSecret, httpClientOptions != null ? new io.vertx.core.http.HttpClientOptions(io.vertx.core.impl.ConversionHelper.toJsonObject(httpClientOptions)) : null)); } public static void discover(io.vertx.ext.auth.oauth2.providers.SalesforceAuth j_receiver, io.vertx.core.Vertx vertx, java.util.Map<String, Object> config, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.auth.oauth2.OAuth2Auth>> handler) {