openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

UX/Bug: Unable to complete OAuth handshake when running core in Docker/WSL2 and Desktop client on Windows Host

Open zahica1234 opened this issue 6 months ago • 0 comments

Problem Description

When running openhuman-core inside a Docker container on WSL2 and running the OpenHuman Desktop client natively on the Windows host, users get trapped in an infinite login loop.

Clicking the Google/GitHub/Twitter authentication buttons successfully opens the host web browser and completes the OAuth flow via tinyhumans.ai. However, because the deep-link handler (openhuman://auth?token=...) tries to route back to the localized client runtime environment, the authentication handshake fails to pass the JWT back to the backend container.

If a user tries to use Run on the Cloud (Complex) to bypass this via http://localhost:7788/rpc, the connection fails because:

  1. The default docker-compose.yml binds ports strictly to 127.0.0.1:7788, isolating it from the Windows virtual network switch.
  2. The internal CLI parser rejects raw token updates with unformatted string errors (invalid JSON params).

The Workaround / Solution

If you are stuck on this screen while using WSL2 + Docker, you can manually inject your authenticated browser token into the core engine using the steps below.

Step 1: Open up the Docker Compose Network Boundary

By default, the container only listens to traffic originating inside Linux. Change your docker-compose.yml file to bind to all interfaces so your Windows Desktop client can reach it over the virtual network bridge:

services:
  openhuman-core:
    # ... rest of configuration
    ports:
      - "0.0.0.0:7788:7788" # Changed from 127.0.0.1:7788:7788
Restart your container:

Bash
docker compose down && docker compose up -d
Step 2: Grab your WSL Network IP
Find your true internal WSL network IP address by running:

Bash
hostname -I | awk '{print $1}'
(Example output: 172.20.66.250)

Step 3: Configure the Desktop App Connection
Clear your desktop app cache to drop old loading states: rm -rf ~/.config/OpenHuman/

Open the OpenHuman Desktop Client.

Select Run on the Cloud (Complex).

Input your Runtime URL using your WSL IP: http://<YOUR_WSL_IP>:7788/rpc

Input your OPENHUMAN_CORE_TOKEN.

Click Test Connection -> Continue.

Step 4: Manually Intercept & Inject the Auth Session
Click your preferred Login provider button (e.g., Google or GitHub).

Look at your web browser's address bar once it redirects to an error page or tries to open an external application protocol.

Copy the URL string, which looks like this:
openhuman://auth?token=<YOUR_JWT_TOKEN>&key=auth

Copy the exact <YOUR_JWT_TOKEN> string segment.

In your WSL terminal, pass the token wrapped as a string token directly to the backend. Note: If you run into JSON parsing errors due to special characters in the JWT, pass the string explicitly like this:

Bash
docker compose exec openhuman-core ./openhuman-core auth store_session --token "\"<PASTE_YOUR_COPIED_JWT_TOKEN_HERE>\""
Once the backend successfully processes the legitimate session JWT token, restart your desktop client app, input your WSL IP runtime details, and you will instantly bypass the splash loop straight into the workspace dashboard!

Suggested Fixes for Maintainers
Documentation Update: Call out WSL2-to-Windows host network requirements (using 0.0.0.0 port bindings instead of looping back explicitly on 127.0.0.1).

CLI Robustness: Improve the token string parsing regex inside the auth store_session --token binary parameter handler to gracefully handle raw strings containing periods (.) or underscores (_) without failing on JSON expectations.

zahica1234 avatar May 24 '26 01:05 zahica1234