@@ -11,11 +11,9 @@ API keys directly.
1111Authentication involves the following commands:
1212
1313* ` datumctl auth login `
14- * ` datumctl auth list `
1514* ` datumctl auth logout `
1615* ` datumctl auth get-token `
1716* ` datumctl auth update-kubeconfig `
18- * ` datumctl auth switch `
1917
2018Credentials and tokens are stored securely in your operating system's default
2119keyring.
@@ -47,6 +45,14 @@ Running this command will:
4745Your credentials (including refresh tokens) are stored securely in the system
4846keyring, associated with your user identifier (typically your email address).
4947
48+ On every successful login, ` datumctl ` also ensures a matching cluster/context
49+ entry exists in ` ~/.datumctl/config ` for the API host you authenticated against.
50+ If a current context already exists, it remains unchanged.
51+
52+ ` datumctl ` stores a list of users in ` ~/.datumctl/config ` and links each context
53+ to a user key (in the ` subject@auth-hostname ` format). The actual tokens are
54+ stored in your OS keyring under the ` datumctl-auth ` service.
55+
5056## Updating kubeconfig
5157
5258Once logged in, you typically need to configure ` kubectl ` to authenticate to
@@ -73,38 +79,8 @@ This command adds or updates the necessary cluster, user, and context entries
7379in your kubeconfig file. The user entry will be configured to use
7480` datumctl auth get-token --output=client.authentication.k8s.io/v1 ` as an ` exec `
7581credential plugin. This means ` kubectl ` commands targeting this cluster will
76- automatically use your active ` datumctl ` login session for authentication.
77-
78- ## Listing logged-in users
79-
80- To see which users you have authenticated locally, use the ` list ` command:
81-
82- ```
83- datumctl auth list
84- # Alias: datumctl auth ls
85- ```
86-
87- This will output a table showing the Name, Email, and Status (Active or blank)
88- for each set of stored credentials. The user marked ` Active ` is the one whose
89- credentials will be used by default for other ` datumctl ` commands and
90- ` kubectl ` (if configured via ` update-kubeconfig ` ).
91-
92- ## Switching active user
93-
94- If you have logged in with multiple user accounts (visible via
95- ` datumctl auth list ` ), you can switch which account is active using the
96- ` switch ` command:
97-
98- ```
99- datumctl auth switch <user-email>
100- ```
101-
102- Replace ` <user-email> ` with the email address of the user you want to make
103- active. This user must already be logged in.
104-
105- After switching, subsequent commands that require authentication (like
106- ` datumctl organizations list ` or ` kubectl ` operations configured via
107- ` update-kubeconfig ` ) will use the credentials of the newly activated user.
82+ automatically use the credentials associated with your current ` datumctl `
83+ context for authentication.
10884
10985## Logging out
11086
@@ -113,11 +89,11 @@ To remove stored credentials, use the `logout` command.
11389** Log out a specific user:**
11490
11591```
116- datumctl auth logout <user-email >
92+ datumctl auth logout <user-key >
11793```
11894
119- Replace ` <user-email > ` with the email address shown in the
120- ` datumctl auth list ` command .
95+ Replace ` <user-key > ` with the key shown in the ` users ` list in
96+ ` ~/. datumctl/config ` . Use ` --all ` to remove all credentials .
12197
12298** Log out all users:**
12399
@@ -129,12 +105,12 @@ This removes all Datum Cloud credentials stored by `datumctl` in your keyring.
129105
130106## Getting tokens (advanced)
131107
132- The ` get-token ` command retrieves the current access token for the * active *
133- authenticated user . This is primarily used internally by other tools (like
108+ The ` get-token ` command retrieves the current access token for the credentials
109+ associated with the current context . This is primarily used internally by other tools (like
134110` kubectl ` ) but can be used directly if needed.
135111
136112```
137- datumctl auth get-token [-o <format>]
113+ datumctl auth get-token [-o <format>] [--cluster <datumctl-cluster>]
138114```
139115
140116* ` -o, --output <format> ` : (Optional) Specify the output format. Defaults to
@@ -143,6 +119,8 @@ datumctl auth get-token [-o <format>]
143119 * ` client.authentication.k8s.io/v1 ` : Prints a Kubernetes ` ExecCredential `
144120 JSON object containing the ID token, suitable for ` kubectl `
145121 authentication.
122+ * ` --cluster <datumctl-cluster> ` : (Optional) Use credentials bound to the
123+ specified datumctl cluster instead of the current context.
146124
147125If the stored access token is expired, ` get-token ` will attempt to use the
148126refresh token to obtain a new one automatically.
0 commit comments