You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/tutorials/authenticate_with_service_account.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
This tutorial provides step-by-step instructions for authenticating your MongoDB Atlas CLI profile using Service Accounts, allowing you to automate and and manage MongoDB resources. Service Accounts, also referred to as OAuth Applications, allows programmatic access through a secure Client ID and Secret—ideal for scripting use cases and CI/CD workflows.
4
4
5
+
__Note:__ This process is interactive. For programmatic authentication, set enviroment variables `MONGODB_ATLAS_CLIENT_ID` and `MONGODB_ATLAS_CLIENT_SECRET` before using the AtlasCLI. See [Atlas CLI Environment Variables](https://www.mongodb.com/docs/atlas/cli/stable/atlas-cli-env-variables/) for all supported environment variables.
6
+
5
7
---
6
8
7
9
### Prerequisites
@@ -18,14 +20,14 @@ Before starting, ensure you have:
18
20
Open your terminal and run the following command:
19
21
20
22
```
21
-
atlas auth login
23
+
atlas auth login --profile myProfile
22
24
```
23
25
24
-
This command initiates the authentication setup for your Atlas CLI profile.
26
+
This command initiates the interactive authentication setup guide for a Atlas CLI profile called 'myProfile'.
25
27
26
28
---
27
29
### Step 2: Select the Authentication Method
28
-
After running `atlas auth login`, you will see the following prompt:
30
+
After running `atlas auth login --profile myProfile`, you will see the following prompt:
29
31
30
32
```
31
33
? Select authentication type: [Use arrows to move, type to filter]
@@ -72,4 +74,6 @@ Next, the CLI will prompt you to select the output format.
72
74
73
75
---
74
76
### Step 5: Authentication Complete
75
-
At this point, your Atlas CLI profile is authenticated using your Service Account. You can now execute authenticated commands in Atlas CLI within the scope of your Service Account permissions.
77
+
At this point, your Atlas CLI profile is authenticated using your Service Account. You can now execute authenticated commands in Atlas CLI within the scope of your Service Account permissions by adding `--profile myProfile` flag to any command you run.
78
+
79
+
For example, `atlas cluster list --profile myProfile`
0 commit comments