Authentication
Numeraire SwissKnife supports multiple authentication methods:
JWT (auth_provider = "jwt")​
Local JWT authentication lets each account sign in with its own username and password through POST /v1/auth/sign-in. Set jwt.secret in the configuration file (and optionally jwt.token_expiry).
On first launch, POST /v1/auth/sign-up creates the initial administrator. Choose a username, a password, and an optional display name. Usernames contain 3–64 ASCII letters, digits, dots, underscores, or hyphens and are normalized to lowercase. Passwords must contain at least 15 characters and no more than 1024 UTF-8 bytes; they are stored as Argon2id hashes.
Administrators can create accounts and enable separate local logins through the dashboard Account directory or the account administration API. The account owner redeems the single-use activation code through POST /v1/auth/reset-password, chooses a password, then signs in with the assigned username.
Signed-in users change their password with POST /v1/auth/change-password. Administrators can issue a reset code for another account, or disable its local login. Activation and reset codes expire after 30 minutes. Password changes, resets, and login disabling revoke that account's local JWT sessions; API keys retain their own lifecycle.
The local credential format changed in 0.3.1. Installations upgrading from the earlier password-only login must set up new local credentials and sign in again with a username.
See the configuration values for JWT here.
OAuth2 (auth_provider = "oauth2")​
OAuth2 authentication allows users to sign in with their OAuth2 provider. The domain and audience need to be set in the configuration file.
oauth2.domain is the OpenID provider issuer base URL. Numeraire SwissKnife resolves the JWKS URI and the canonical issuer from this base via OpenID Connect (OIDC) discovery (the scheme defaults to https when omitted), so it works with any OIDC-compliant provider, not just Auth0. It will then automatically fetch the JWK Set in intervals (jwks_refresh_interval) from the provider and validate the JWT, enabling key rotation.
On the first authenticated request, the provider's sub is idempotently mapped to an account and that account's native-BTC wallet for the configured network is made available. Concurrent first requests resolve to the same account and wallet.
See the configuration values for OAuth2 here.
Tested with Auth0.
API keys​
In addition to JWT and OAuth2, requests can be authenticated with an API key. API keys are created per account and can always use that account's ownership-scoped /v1/me routes. Their permission array grants additional administrative API access.
Not finding your preferred auth method?​
If you want to use a different authentication method, please open a feature request on our GitHub repository.