Skip to content

Latest commit

 

History

History
38 lines (33 loc) · 1.45 KB

File metadata and controls

38 lines (33 loc) · 1.45 KB

Tutorials

1) OAuth2 with the local dev server

This app supports OAuth2/OIDC Authorization Code + PKCE. You can test against the included sample server in the Oauth2/ repo.

Steps (example):

  1. Start the auth server (in its repository):
    export ENABLE_DEV_ENDPOINTS=true
    uv run server.py
  2. In a browser, go to http://127.0.0.1:8000/admin/ui and create/update a client named opensentry-command:
    • Redirect URI: http://localhost:5000/oauth2/callback (and/or http://127.0.0.1:5000/oauth2/callback)
    • Token auth: none (public, PKCE) or client_secret_post (confidential)
    • Allowed/default scopes: openid profile email offline_access
  3. Start OpenSentry Command:
    uv run main.py
  4. Open the app and visit /settings:
    • Auth mode: oauth2
    • Base URL: http://127.0.0.1:8000 (or http://host.docker.internal:8000 when containerized)
    • Client ID: opensentry-command
    • Client Secret: (only if confidential client)
    • Scope: openid profile email offline_access
  5. Click Save. Now log in.

If the provider is down, the app will offer a one-time local-login fallback.

2) Discover and manage devices

  • On the home page, run mDNS discovery (service _opensentry._tcp.local.).
  • Provide a Bearer token if devices protect /status.
  • Click a device to view details; use the form to pin (persist) devices.

3) CLI discovery

uv run discover.py --timeout 3.0 --status --token <TOKEN>