eclipse-vertx / vertx-auth

Apache License 2.0
166 stars 156 forks source link

Documentation uses deprecated API #689

Open jakub-bochenski opened 1 month ago

jakub-bochenski commented 1 month ago

E.g.

OAuth2Options credentials = new OAuth2Options()
  .setFlow(OAuth2FlowType.CLIENT)
  .setClientId("<client-id>")
  .setClientSecret("<client-secret>")
  .setSite("https://api.oauth.com");

// Initialize the OAuth2 Library
OAuth2Auth oauth2 = OAuth2Auth.create(vertx, credentials);

JsonObject tokenConfig = new JsonObject();

oauth2.authenticate(tokenConfig)
  .onSuccess(user -> {
    // Success
  })
  .onFailure(err -> {
    System.err.println("Access Token Error: " + err.getMessage());
  });

https://vertx.io/docs/vertx-auth-oauth2/java/#_client_credentials_flow

.setFlow(OAuth2FlowType.CLIENT) and oauth2.authenticate(tokenConfig) taking JsonObject are both deprecated