Login endpoint switches from HS256 JWT to RS256 id_token (aud="bincio",
30-day TTL) when oidc_private_key_pem is set. Existing HS256 sessions
remain valid on bincio-activity until they naturally expire.
Add OIDC/OAuth2 endpoints to bincio-auth so it acts as a full IdP:
GET /.well-known/openid-configuration
GET /.well-known/jwks.json
GET /oauth2/authorize (auth-code flow, redirects to /login/ if no session)
POST /oauth2/token (exchanges code for RS256 id_token; PKCE supported)
GET /oauth2/userinfo (Bearer token → profile claims)
Infrastructure:
- oauth2_clients + oauth2_codes tables in db.py with CRUD helpers
- RS256 sign/verify helpers in tokens.py (create_id_token, get_jwks)
- oidc_private_key_pem / oidc_issuer state + _issue_id_token in deps.py
- serve_cmd reads BINCIO_OIDC_PRIVATE_KEY_FILE / BINCIO_OIDC_ISSUER env vars
- `bincio-auth client add/list` commands for managing OAuth2 clients
bincio-auth.service: runs at port 4040, reads BINCIO_AUTH_JWT_SECRET
from /etc/bincio/secrets.env (shared with bincio-activity).
show-secret: prints the JWT secret stored by 'bincio-auth init',
so the operator can add it to secrets.env without raw sqlite3.