snaplogic auth

Sign in, sign out, and check the current credential for the SnapLogic platform.

Sign-in methods

The SnapLogic CLI supports two sign-in methods. Use one method only; don't combine them.

Method How to set it up Best for
Browser single sign-on (SSO) Run snaplogic auth login. The CLI stores an SLToken in a local credentials file. Interactive users and SSO-enforced organizations
Username and password Set SNAPLOGIC_API_USER and SNAPLOGIC_API_PASS environment variables. Non-interactive scripts and CI/CD pipelines with Basic auth
Important: If both a stored browser token and username/password environment variables are present, run snaplogic auth status to confirm which credential is active.

snaplogic auth login

It authenticates through the browser using the OAuth 2.0 authorization code flow with Proof Key for Code Exchange (PKCE) and stores the resulting SLToken locally so other commands can use it without prompting again. Set SNAPLOGIC_BASE_URL to your control plane URL before running this command.

snaplogic auth login [--org <name>] [--no-browser]
Flag Description
--org <name> Sets or changes the default organization using the existing login, without opening the browser again. Organization names are case-sensitive.
--no-browser Prints the authorization URL instead of opening the browser automatically. Use this in headless environments where the browser cannot open on its own. Copy the URL, open it in a browser on the same machine, complete the sign-in, and the CLI captures the callback automatically.

If --org is not used and SNAPLOGIC_ORG_NAME is not set, auth login asks which Org/Environment to use when it runs in a terminal. If it cannot ask or you skip the question, it leaves the default Org/Environment unset. Username and password users have no interactive Org/Environment picker; set SNAPLOGIC_ORG_NAME before running commands that require an Org/Environment, such as snaplogic slpy install.

How sign-in works

  1. The CLI starts a temporary loopback server on a random port and opens your browser to the SnapLogic authorization page.
  2. Sign in to SnapLogic with your existing account. This step is skipped if you are already signed into that browser.
  3. Approve the Authorize SnapLogic CLI request. Click Allow access. The browser displays a confirmation and the terminal prints the sign-in details. The SLToken is stored locally.
Note: If a valid sign-in already exists, auth login prints "Already signed in" and exits without reopening the browser. To sign in as a different user, run snaplogic auth logout first.

Session renewal

A browser sign-in renews itself automatically while it is being used. You need to sign in again when the session has gone unused past the idle limit, when it reaches its maximum lifetime, or after signing out of SnapLogic Platform. Run snaplogic auth status to see both limits for your current session.

snaplogic auth logout

Clears the stored browser sign-in for the current control plane address. Does not affect username and password environment variables.

snaplogic auth logout

After signing out, commands that require authentication will fail until you sign in again or set the username and password environment variables.

snaplogic auth status

Shows the current credential for each configured control plane address: method (token or basic), source (stored or env), and session limits for browser sign-ins.

snaplogic auth status [--verify] [--json]
Flag Description
--verify Also checks the credential against the platform with a live call. Exits 0 if the credential is accepted, 1 if it is rejected. Not on by default: Refer to the caution below.
--json Prints output as a JSON array, one object per signed-in deployment. Never includes the token.
CAUTION: Running auth status --verify makes a live call to the platform. A wrong username and password counts toward account lockout, so --verify is not the default. Use it only to confirm that a known credential is accepted, not to test a password you are unsure about.

snaplogic auth token

Prints the current valid SLToken to standard output. Exits non-zero if no token is stored or the token is expired.

snaplogic auth token

Use this in scripts to pass the token as an HTTP header:

curl -H "Authorization: SLToken $(snaplogic auth token)" ...
Note: This command prints a live credential. Do not share the output or paste it into chat or logs.

Credential storage

The browser sign-in token is stored in a local credentials file. The file is restricted to the current user (permissions 0600 on macOS and Linux) and is keyed by control plane address, so multiple environments can coexist.

Platform Location
macOS ~/Library/Application Support/snaplogic/credentials.json
Linux ~/.config/snaplogic/credentials.json
Windows %APPDATA%\snaplogic\credentials.json

Running snaplogic auth logout removes the entry for the current control plane address from this file.

Exit codes

  • 0: Success
  • 1: API or authentication error (for example, rejected credential on --verify, or no stored token for auth token)
  • 2: Configuration error