# Keycloak JavaFX Desktop App Adapter: after successfully authenticated received token but the browser tab shows : We are sorry... Page not found

**URL:** <https://forum.keycloak.org/t/keycloak-javafx-desktop-app-adapter-after-successfully-authenticated-received-token-but-the-browser-tab-shows-we-are-sorry-page-not-found/15421>\
**Category:** Getting advice\
**Tags:** authentication, oidc\
**Created:** [May 8, 2022, 8:38pm UTC](https://forum.keycloak.org/t/keycloak-javafx-desktop-app-adapter-after-successfully-authenticated-received-token-but-the-browser-tab-shows-we-are-sorry-page-not-found/15421 "2022-05-08T20:38:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hemeda3](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/hemeda3/32/5782_2.png) [@hemeda3](https://forum.keycloak.org/u/hemeda3)\
**Post date:** [May 8, 2022, 8:38pm UTC](https://forum.keycloak.org/t/keycloak-javafx-desktop-app-adapter-after-successfully-authenticated-received-token-but-the-browser-tab-shows-we-are-sorry-page-not-found/15421/1 "2022-05-08T20:38:41Z")

</div>

Hi folks,  
This forum is super helpful, thanks for all time and efforts you put here.  
I am developing a JavaFx desktop application following [installed-adapter.adoc](https://github.com/keycloak/keycloak-documentation/blob/main/securing_apps/topics/oidc/java/installed-adapter.adoc)  
this is my public keycloak.json

```auto
{
  "realm": "xyz",
  "auth-server-url": "https://keycloak.xyz.com/auth",
  "ssl-required": "external",
  "resource": "xyz-mobile",
  "public-client": true,
  "confidential-port": 0,
  "use-resource-role-mappings": true,
  "enable-pkce": true
}

```

and the Java code just copy/paste from the documentation [installed-adapter.adoc] I added nothing more.

My JavaFX was able to open browser tab, login form, then I logged in successfully, , received token everything is great, but I notice after getting the token I got redirected to this link:  
**[https://keycloak.xyze.com/auth/realms/xyzecoin/protocol/openid-connect/delegated](https://keycloak.xyze.com/auth/realms/xyzecoin/protocol/openid-connect/delegated)**  
with message in the opened browser tab:

> We are sorry… Page not found

While the JavaFx application got the token, but the user will be confused if found that browser tab show the message.`We are sorry... Page not found`,  
I want to close tab automatically or tell them `everything thing is fine, please close the tab`.

Any idea why I am getting redirected to `openid-connect/delegated` instead of the page that shows `please close your browser` like in mobile app and what is the missing configuration?

---

<div class="post-metadata">

**Author:** ![robinschmid](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/robinschmid/32/9333_2.png) [@robinschmid](https://forum.keycloak.org/u/robinschmid)\
**Post date:** [December 29, 2023, 11:20am UTC](https://forum.keycloak.org/t/keycloak-javafx-desktop-app-adapter-after-successfully-authenticated-received-token-but-the-browser-tab-shows-we-are-sorry-page-not-found/15421/2 "2023-12-29T11:20:34Z")

</div>

did you find a solution to use it within JavaFX?

---

<div class="post-metadata">

**Author:** ![Carl](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/carl/32/10443_2.png) [@Carl](https://forum.keycloak.org/u/Carl)\
**Post date:** [January 1, 2024, 4:10pm UTC](https://forum.keycloak.org/t/keycloak-javafx-desktop-app-adapter-after-successfully-authenticated-received-token-but-the-browser-tab-shows-we-are-sorry-page-not-found/15421/3 "2024-01-01T16:10:40Z")

</div>

A JavaFX app I was working on used JxBrowser. JxBrowser can intercept navigation events and bury the call to /delegated. You’re probably not using JxBrowser, but the approach might work for the standard WebView/Engine if you launch the Keycloak login that way.

If you’re relying on the desktop browser, you might consider an embedded browser to have more control.

“br” below is a JxBrowser Browser object.

```
    br.navigation().set(StartNavigationCallback.class, params -> {
        // this keycloak endpoint was removed and returning "Page not found" after a successful login
        if (params.url().contains("/delegated")) {
            return StartNavigationCallback.Response.ignore();
        }
        return StartNavigationCallback.Response.start();
    });

```

---

<div class="post-metadata">

**Author:** ![robinschmid](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/robinschmid/32/9333_2.png) [@robinschmid](https://forum.keycloak.org/u/robinschmid)\
**Post date:** [January 9, 2024, 8:29am UTC](https://forum.keycloak.org/t/keycloak-javafx-desktop-app-adapter-after-successfully-authenticated-received-token-but-the-browser-tab-shows-we-are-sorry-page-not-found/15421/4 "2024-01-09T08:29:13Z")

</div>

Interesting solution. Thanks for the feedback. It would be interesting if one can navigate on WebView in a similar way.
