private String authURI(String redirectURL) { final JsonObject config = new JsonObject() .put("state", redirectURL); if (host != null) { config.put("redirect_uri", host + callback.getPath()); } if (extraParams != null) { config.mergeIn(extraParams); } if (scopes.size() > 0) { JsonArray _scopes = new JsonArray(); // scopes are passed as an array because the auth provider has the knowledge on how to encode them for (String authority : scopes) { _scopes.add(authority); } config.put("scopes", _scopes); } return ((OAuth2Auth) authProvider).authorizeURL(config); }
/** * Generate a redirect URL to the authN/Z backend. It only applies to auth_code flow. * @param params * @return */ public String authorizeURL(JsonObject params) { String ret = delegate.authorizeURL(params); return ret; }
/** * Generate a redirect URL to the authN/Z backend. It only applies to auth_code flow. * @param params * @return */ public String authorizeURL(JsonObject params) { String ret = delegate.authorizeURL(params); return ret; }
private String generateAuthRedirectURI(String from) { return oauth2.authorizeURL(new JsonObject() .put("redirect_uri", from + "/callback?redirect_uri=" + from) .put("scope", "") .put("state", "")); }
public static java.lang.String authorizeURL(io.vertx.ext.auth.oauth2.OAuth2Auth j_receiver, java.util.Map<String, Object> params) { return j_receiver.authorizeURL(params != null ? io.vertx.core.impl.ConversionHelper.toJsonObject(params) : null); } public static void getToken(io.vertx.ext.auth.oauth2.OAuth2Auth j_receiver, java.util.Map<String, Object> params, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.auth.oauth2.AccessToken>> handler) {
private String authURI(String redirectURL) { final JsonObject config = new JsonObject() .put("state", redirectURL); if (host != null) { config.put("redirect_uri", host + callback.getPath()); } if (extraParams != null) { config.mergeIn(extraParams); } if (scopes.size() > 0) { JsonArray _scopes = new JsonArray(); // scopes are passed as an array because the auth provider has the knowledge on how to encode them for (String authority : scopes) { _scopes.add(authority); } config.put("scopes", _scopes); } return ((OAuth2Auth) authProvider).authorizeURL(config); }
@Test public void generateAuthorizeURL() throws Exception { String expected = "http://localhost:8080/oauth/authorize?redirect_uri=" + URLEncoder.encode("http://localhost:3000/callback", "UTF-8") + "&scope=user&state=02afe928b&response_type=code&client_id=client-id"; assertEquals(expected, oauth2.authorizeURL(authorizeConfig)); }