Authentication
Resolve login failures, expired tokens, API key issues, and collection access errors with the Bricks CLI and Bluebricks app
Quick reference
bricks login fails or times out
Browser did not open, code expired, or network blocking auth.bluebricks.co
Re-run bricks login; check network/proxy if it times out
"Login was denied" error
Signed in with a personal account
Re-run bricks login and use an organization account
"Token expired" errors
JWT token has expired
Run bricks logout then bricks login
API key rejected
Key revoked or invalid
Generate a new key in Account settings > Integrations > Bluebricks API Key
"User not authorized"
Session expired or credentials invalid
Re-authenticate with bricks login or verify API key
"Not assigned to collection"
No access to the target collection
Request access from a collection owner
bricks login fails or times out
bricks login fails or times outBricks CLI uses a device authorization flow. When you run bricks login, the CLI displays a verification code and opens your browser to complete authentication.
Common causes
Browser did not open: your terminal cannot launch a browser (common in headless or SSH sessions)
Code expired: the device code expires after a few minutes
Network issues: the CLI cannot reach
auth.bluebricks.co(firewall, proxy, or VPN blocking outbound HTTPS)VPN or proxy interference: corporate networks may block the polling requests between the CLI and the authentication server
How to fix
Run
bricks loginagainIf the browser does not open, manually navigate to the URL shown in the terminal
Enter the device code displayed in your terminal
After the browser confirms success, return to the terminal
If the CLI times out waiting for approval, check that your network allows outbound HTTPS to auth.bluebricks.co. For corporate networks with a proxy, set your terminal's HTTPS_PROXY environment variable.
If you are in a headless environment (CI/CD, SSH), use an API key instead of interactive login.
API keys can be created in the Bluebricks app without using the CLI login flow:
Go to Account settings > Integrations > Bluebricks API Key
Enter a name and generate a new key
Copy the key and set it as an environment variable:
Token expired errors
JWT tokens issued by bricks login expire after a set period. When a token expires, CLI commands return authentication errors.
How to fix
Verify the new session:
If you use API keys for automation, tokens do not expire unless revoked. Check that your key is still active in Account settings > Integrations > Bluebricks API Key.
"Login was denied" error
The device authorization flow returns this error when the CLI cannot complete authentication. The error message begins with: login was denied or cancelled. You may not have organization access, or you chose a personal account.
Common causes
Personal account selected: Bluebricks requires an organization account. Personal accounts are not supported
Authorization cancelled: you closed the browser tab or clicked "Deny" during the approval step
No organization access: your account is not a member of any Bluebricks organization
How to fix
Run bricks login again and sign in with your organization account when prompted in the browser.
If you are unsure which account to use, check with your organization admin.
Authentication priority order
When multiple authentication sources are configured, the CLI resolves them in this order:
CLI flag:
--api-keypassed directly to the commandEnvironment variable:
BRICKS_API_KEYConfig file:
~/.bricks/config.yamlJWT token:
~/.bricks/credentials.yaml(set bybricks login)
The first source found wins. The CLI also checks the current working directory for a config.yaml, which takes precedence over the home directory config. If you are getting unexpected behavior, check whether a higher-priority source is overriding your intended credentials.
Do not store real API keys in shared CI/CD logs or version control. Use environment variables or secret managers to inject BRICKS_API_KEY at runtime.
API key rejected
API keys can be rejected if they have been revoked, are malformed, or belong to a different organization.
How to fix
Go to Account settings > Integrations > Bluebricks API Key
Check that your key is listed and has not been revoked
If the key is missing or revoked, enter a name and generate a new one
Update your environment variable or config with the new key
Test your current authentication:
If the command fails, set a valid key and retry:
Not assigned to collection
You see User not assigned to collection when you try to access a collection you do not have permissions for. This is different from "User not authorized," which means your session or credentials are invalid. Here, your authentication is fine, but you are not a member of the target collection.
How to fix
Ask a collection owner or organization admin to add you to the collection
The owner can do this from the collection's Overview tab under Assigned users
Once added, retry the operation
List the collections you have access to:
If the target collection is not in the list, you need a collection owner or admin to grant you access.
For background on collection access control, see Collections in the main documentation.
Need more help?
Enable logging:
bricks logger enableReproduce the issue
Check
~/.bricks/logs/for the latest log file (e.g.,bricks_14_04_2026.log)Contact support with the relevant log output
Last updated