This demo runs two Daptin instances:
- Provider:
http://localhost:6337 - Consumer:
http://localhost:6336
The consumer uses the provider through the standard OAuth 2.0 authorization-code flow. There is no helper web server in this demo.
docker compose up -d
python3 scripts/setup.pyThe compose file uses daptin/daptin:latest by default. To test another locally built or published image:
DAPTIN_IMAGE=daptin/daptin:latest docker compose up -dAfter setup, start the login flow with:
scripts/start-login.shOpen the printed URL if the script does not open it automatically:
http://localhost:6336/oauth/login/<authenticator>
Expected flow:
- Consumer
/oauth/login/<authenticator>creates OAuth state and redirects to provider/oauth/authorize. - Provider sends the browser to native Daptin
/auth/signinif there is no provider session. - Sign in with the provider demo account printed by
scripts/setup.py. - Provider redirects to consumer
/oauth/response?authenticator=<authenticator>&code=...&state=.... - Consumer exchanges the code at provider
/oauth/token, fetches profile from provider/oauth/userinfo, creates or finds the user, sets the normal Daptin HttpOnlytokencookie, and redirects to/.
If the dashboard frontend later routes to /sign-in, check the network response for /oauth/response: the OAuth callback is complete when that response is 302 and includes Set-Cookie: token=....
Dashboard support for showing a native "Sign in with OAuth provider" action is tracked separately in artpar/dashboard3#2.
The provider app must register the exact consumer callback URL:
http://localhost:6336/oauth/response?authenticator=<authenticator>
The consumer oauth_connect.redirect_uri stores the base callback:
http://localhost:6336/oauth/response
Daptin appends authenticator=<oauth_connect.name> while building the authorization URL.
The consumer does not know or care that the provider is Daptin. It uses the configured OAuth URLs:
auth_url: browser-facing provider/oauth/authorizetoken_url: consumer-to-provider/oauth/tokenprofile_url: consumer-to-provider/oauth/userinfo
docker compose down -v
rm -f .env.local