最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - Vertx OAuth2 Error on Authentification " invalid_grant: Incorrect redirect_uri" - Stack Overflow

programmeradmin3浏览0评论

I'm currently exchanging a custom oAuth2 implementation with the vertx OAuth2 library. I was following the guide on the Vertx Documentation for the code Flow.

Somehow at the end I get this error and I can't grasp what is wrong. I double checked and tried multiple things unsuccesfully.

At the end I still get this error:

invalid_grant: Incorrect redirect_uri
JsonObject config= new JsonObject();
    tokenConfig.put("code", authCodeFromProvider);
    tokenConfig.put("redirect_uri", redirectionUri);



oauth2.authenticate(tokenConfig).onSuccess(
      reponse-> {
       //CODE FOR Succesful Repsonse is here IS HERE
      }
    ).onFailure(err -> {
      //CODE FOR LOG IS HERE
    });

Example from Vertx Doc.

// Redirect example using Vert.x
response.putHeader("Location", authorization_uri)
  .setStatusCode(302)
  .end();

JsonObject tokenConfig = new JsonObject()
  .put("code", "<code>")
  .put("redirectUri", "http://localhost:3000/callback");

// Callbacks
// Save the access token
oauth2.authenticate(tokenConfig)
  .onSuccess(user -> {
    // Get the access token object
    // (the authorization code is given from the previous step).
  })
  .onFailure(err -> {
    System.err.println("Access Token Error: " + err.getMessage());
  });

Debugged the application, I tried to reconfigure the oauth provider visited blogs.

发布评论

评论列表(0)

  1. 暂无评论