Open exmoria opened 1 year ago
I believe the "callback" url isn't being properly configured, I'll debug the situation, and on the meantime, you can try to do:
router.route().handler(SessionHandler.create(LocalSessionStore.create(vertx)));
router.route("/protected/*").handler(
OAuth2AuthHandler.create(vertx, githubAuth, "http://localhost:8080/callback")
.withScope("profile")
.setupCallback(router.route("/callback")));
As doing it all inline, might trigger the right setup.
The OAuth2AuthHandler seems to be working as expected after all, but only with the futures-based API.
My router instance was probably referencing another object - a silly mistake on my part. For anyone that should happen to come across this issue in the future, make sure to declare your router instance as final:
final Router router = Router.router(vertx);
I'm also working on a project using the mutiny bindings and the issue persists there. Getting 404s with the github provider like in the video snippet above, and missing scopes with the google provider:
I've managed to track down an issue where someone was having similar troubles in the past: https://github.com/smallrye/smallrye-mutiny-vertx-bindings/issues/502
Also, on a somewhat related note, there seems to be an issue with the github provider when performing revocations of access/refresh tokens with:
oauth2.revoke(ctx.user())
The exception:
Failed to logout user io.vertx.core.impl.NoStackTraceThrowable: Forbidden: Cookies must be enabled to use GitHub.
Token revocations using the google provider seem to be working as intended and will prompt for re-authentication.
Version
4.3.7
Context
Upon successful authentication using the OAuth2Auth handler, a session should be instantiated and I should be able to access the '/protected' route, but instead I'm getting 404 responses. Am I missing something here?
https://user-images.githubusercontent.com/39838515/211918950-737e36ae-3316-4a22-a157-3e43653113fb.mp4
I've included the relevant code snippet: