Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Freudensprung committed Mar 26, 2024
1 parent 796c92f commit 0295bbc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ Wait something like 10 seconds, or until `docker compose logs -f` is showing som
```
2024-03-26 13:28:05,084 WARN [org.keycloak.quarkus.runtime.KeycloakMain] (main) Running the server in development mode. DO NOT use this configuration in production.
```
Keycloak is running on port 8001

Keycloak admin user/password: admin/admin

Realm: demo-realm

Client: demo-client

Demo user/password: demo-user/demo-user


# Start Vert.x backend
Tested with OpenJDK 11 and Maven 3.8.1
Expand All @@ -22,3 +32,4 @@ mvn compile exec:java

http://localhost:8000/

Login with user/password: demo-user/demo-user
4 changes: 3 additions & 1 deletion src/main/java/org/bfreuden/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public Future<Void> startServer(OAuth2Auth oAuth2Auth) {
.setupCallback(router.route("/oauth2/callback"))
.withScope("openid");

// API protected with OAuth2
// API protected with OAuth2 like in the vert.x example:
// https://github.com/vert-x3/vertx-examples/blob/b6194db5b5e7eac3173f8c968c9ecac8e4a567f9/web-examples/src/main/java/io/vertx/example/web/oauth2/Server.java#L45
router.route("/api/*")
.handler(oauth2Handler);

Expand Down Expand Up @@ -110,6 +111,7 @@ private void logout(RoutingContext ctx) {

private void keycloakLogout(RoutingContext ctx) {
String endSessionURL = oAuth2Auth.endSessionURL(ctx.user());
// not required because Front-channel logout is working
// clearSessionAndUser(ctx);
ctx.response()
.setStatusCode(302)
Expand Down

0 comments on commit 0295bbc

Please # to comment.