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
Authenticate using OAuth providers (e.g., Google) to obtain access tokens. This command opens your browser for authentication and returns access and refresh tokens.
40
+
41
+
```bash
42
+
supermq-cli users oauth <provider>
43
+
```
44
+
45
+
Example with Google:
46
+
47
+
```bash
48
+
supermq-cli users oauth google
49
+
```
50
+
51
+
**How it works:**
52
+
53
+
1. The CLI starts a local HTTP server on `localhost:9090` to receive the OAuth callback
54
+
2. Opens your default browser to the OAuth provider's authorization page
55
+
3. After you authenticate with the provider, you'll be redirected back to the CLI
56
+
4. The CLI exchanges the authorization code for access and refresh tokens
57
+
5. Tokens are displayed in JSON format
58
+
59
+
**Output:**
60
+
61
+
```json
62
+
{
63
+
"access_token": "eyJhbGc...",
64
+
"refresh_token": "eyJhbGc..."
65
+
}
66
+
```
67
+
68
+
**Prerequisites:**
69
+
70
+
The OAuth provider must be configured on the SuperMQ server. For Google OAuth, the following environment variables must be set:
71
+
72
+
-`SMQ_GOOGLE_CLIENT_ID` - Google OAuth client ID
73
+
-`SMQ_GOOGLE_CLIENT_SECRET` - Google OAuth client secret
0 commit comments