If UserAccount authentication is not an option, like for automation usage, you can create choose ServiceAccount
atlas auth login
Warning: Secure storage is not available, falling back to insecure storage
To disable this alert, run "atlas config set silence_storage_warning true"
? Select authentication type: [Use arrows to move, type to filter]
> UserAccount - (best for getting started)
ServiceAccount - (best for automation)
APIKeys - (for existing automations)
You will be asked for Client ID and Client Secret by the CLI, so create one first from the dashboard: Security > Project Identity & Access > Applications > Create service account. Apart from the credentials, the CLI will ask for the organization and project IDs which you can find from the dashboard (Project Overview > Gear icon)
All values are optional and you can use environment variables (MONGODB_ATLAS_*) instead.
Enter [?] on any option to get help.
? Client ID: ****
? Client Secret: [? for help] **************************************************
A simple check you can do is just list the clusters (it will depend on the role you assigned to the service account, but if you’ve the project owner role, this will work): atlas cluster list