How it works
The browser goes to UnityX with a PKCE challenge and returns with a one-time code. The 1Network API trades the code for the UnityX user and starts a normal 1Network session.
1. GET /api/auth/unityx/status -> { enabled, authUrl }
2. redirect to https://auth.unx.ng/?callback=<site>/auth/sign-in/&state=<random>&challenge=<S256 of verifier>
3. back with ?unx_code=...&unx_state=...
4. POST /api/auth/unityx/exchange { code, codeVerifier } -> { token, user } + session cookie
Allow the site in UnityX
A UnityX admin adds 1Network as a domain, so UnityAuth accepts the return address.
Domain / allowed host: ngx.1network.com.ng
Trusted origin: https://ngx.1network.com.ng
Switch it on in 1Network
Set this in the server's .env and restart the 1Network backend. The other settings have working defaults.
UNITYX_ENABLED=1
# UNITY_AUTH_URL=http://127.0.0.1:4420
# UNITYX_SITE_ORIGIN=https://ngx.1network.com.ng
# UNITYX_AUTH_PUBLIC_URL=https://auth.unx.ng
In short
UnityX only signs in people whose email is verified. 1Network matches them by email, creates the account the first time, and links UnityX to it. The same session works for the website and the mobile app.
The guide in the repository, UNITYX_INTEGRATION.md, has the same steps and the local test setup.