OAuth 2.0 client-credentials token management for Railsr.
Tokens are automatically cached by Railsr.Auth.TokenCache and refreshed
transparently 60 seconds before expiry. You should never need to call this
module directly — Railsr.HTTP handles auth automatically.
Token Scopes
Railsr issues scoped tokens. Common scopes:
| Scope | Purpose |
|---|---|
urn:railsr:endusers | Create / update endusers |
urn:railsr:endusers.readonly | Read endusers |
urn:railsr:ledgers | Create / update ledgers |
urn:railsr:transactions | Initiate transactions |
urn:railsr:beneficiaries | Manage beneficiaries |
urn:railsr:cards | Manage cards |
urn:railsr:debit | Mandates & payments |
urn:railsr:firewall | Compliance firewall rules |
urn:railsr:notifications | Webhook config |
urn:railsr:quarantine | Resolve quarantine |
Summary
Functions
Returns the list of all available OAuth scopes.
Fetch a fresh OAuth 2.0 bearer token from Railsr.
Functions
@spec all_scopes() :: [String.t()]
Returns the list of all available OAuth scopes.
@spec fetch_token(keyword()) :: {:ok, Railsr.Types.Token.t()} | {:error, Railsr.Error.t()}
Fetch a fresh OAuth 2.0 bearer token from Railsr.
Normally called only by Railsr.Auth.TokenCache. Prefer
Railsr.Auth.TokenCache.get_token/0 which returns a cached, auto-refreshed token.