lofty-cli supports four authentication methods. They are evaluated in priority order at every command invocation: the first one that yields a valid access token wins. Pick the method that fits how you are running the CLI.
Tokens obtained by Token URL, Browser OAuth, and Client Credentials are cached locally and refreshed automatically when they expire.
Token URL (highest priority)
Token URL (highest priority)
Use this when an upstream system can mint a session ID and exchange it for tokens through a custom endpoint.You can also pass the values inline:Tokens are cached at
~/.config/tokens/lofty-session-cache.json and refreshed transparently.Browser OAuth (recommended for humans)
Browser OAuth (recommended for humans)
The simplest method for interactive use. The CLI launches your default browser, you log in once, and the token is stored locally.The flow uses OAuth 2.0 with PKCE — no client secret is needed on your machine.
OAuth client credentials
OAuth client credentials
Use this for server-to-server scenarios where there is no human to complete a browser flow. Implements the OAuth 2.0 Client Credentials Grant with an additional resource owner identifier.
1
Register an OAuth application
Sign in to the Lofty Developer Portal to create an application and obtain your
client_id and client_secret.2
Configure client credentials
3
Specify the target account
The customer key identifies which Lofty account’s data the CLI will access (the resource owner). Each Lofty user has a unique API key — find it in the Lofty CRM under Settings > Integrations > API.
4
Exchange for an access token
Unlike a standard Client Credentials Grant where the client acts on its own behalf, Lofty requires
LOFTY_CUSTOMER_KEY to specify which account to access. The token is scoped to that account’s data and permissions.Direct access token
Direct access token
When another system has already obtained an access token (e.g. a CI job that ran No
auth login upstream), inject it directly:auth login* command is required; the token is used as-is.Verifying authentication
Logging out
Where credentials live on disk
Troubleshooting
Ifauth test fails, see Troubleshooting for the common causes (clock skew, expired refresh token, wrong customer key, missing scope).