Skip to content

Commit f459d39

Browse files
fix: oauth integration with litmus docs (#169)
Signed-off-by: Hemanth Krishna <[email protected]>
1 parent e45096a commit f459d39

File tree

3 files changed

+36
-7
lines changed

3 files changed

+36
-7
lines changed

website/docs/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@ Once GitOps is enabled, any new workflows created will be stored in the configur
8484

8585
### How to solve `invalid token` issue in litmusctl?
8686

87-
You can use the command `litmusctl config set-account` to generate a new token. You get `invalid token` error if the authorization token is expired. Authorization token has a life span of 24 hours.
87+
You can use the command `litmusctl config set-account` to generate a new token. You get `invalid token` error if the authorization token is expired. Authorization token has a life span of 24 hours.

website/docs/troubleshooting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@ The following command can be used to do the same
106106

107107
```
108108
litmusctl config set-account
109-
```
109+
```

website/docs/user-guides/chaoscenter-oauth-dex-installation.md

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Make sure you have your Google and GitHub Client credentials ready, if you do no
4040

4141

4242
```bash
43-
curl https://raw.githubusercontent.com/litmuschaos/litmus/8d025a2f3101990a1acc002612fbe7281dcbfb4d/litmus-portal/dex-server/dex-deployment.yaml --output dex-deployment.yaml
43+
curl https://raw.githubusercontent.com/litmuschaos/litmus/master/litmus-portal/dex-server/dex-deployment.yaml --output dex-deployment.yaml
4444
```
4545

4646
1. Open the file with your favorite text-editor
@@ -58,6 +58,7 @@ curl https://raw.githubusercontent.com/litmuschaos/litmus/8d025a2f3101990a1acc00
5858
redirectURIs:
5959
- '/auth/dex/callback'
6060
- 'http://localhost:8080/auth/dex/callback' # Included for local testing purposes
61+
- 'https://<REPLACE_FRONTEND_URL>/auth/dex/calllback' #TODO: Replace with you frontend URL
6162
name: 'LitmusPortalAuthBackend'
6263
secret: ZXhhbXBsZS1hcHAtc2VjcmV0
6364
oauth2:
@@ -108,25 +109,53 @@ mongo-0 1/1 Running 0
108109

109110
To set up Dex, we would require to modify our litmusportal-server a bit in order to communicate with Dex. This will be achieved by adding some environment variables
110111

111-
- `OIDC_ISSUER`: The place where the Dex OIDC lives, i.e `NODE_IP:32000`
112+
- `OIDC_ISSUER`: The place where the Dex OIDC is hosted, i.e `NODE_IP:32000` or `https://dex.yourdomain.com`
112113
- `DEX_ENABLED`: This variable enables dex features in the litmusportal-server
113-
- `CALLBACK_URL`: This is the url that will be called back after user completes thier OAuth, this will be the litmusportal-frontend service
114+
- `DEX_OAUTH_CALLBACK_URL`: This is the url that will be called back after user completes thier OAuth, this will be the litmusportal-frontend service
114115

115116
Set your variables using
116117

117118
```bash
118-
kubectl set env deployment/litmusportal-server -n litmus --containers="auth-server" DEX_SERVER="true", OIDC_ISSUER=<REPLACE_NODE_IP>:32000, CALLBACK_URL=<REPLACE_litmusportal_frontend_Service>
119+
kubectl set env deployment/litmusportal-server -n litmus --containers="auth-server" DEX_ENABLED=true OIDC_ISSUER=<REPLACE_NODE_IP>:32000 DEX_OAUTH_CALLBACK_URL=https://<REPLACE_FRONTEND_URL>/auth/dex/callback
119120
```
120121
Your litmusportal-server pod will be restarted and Dex features will be enabled!
121122

122123
### Verifying if OAuth2 is enabled
123124

125+
Run the following command to check the env variables of the `auth-server`
126+
127+
```bash
128+
kubectl describe deployment litmusportal-server -n litmus auth-server
129+
```
130+
131+
Under `auth-server`, verify if the `DEX_ENABLED` variables are set
132+
133+
<span style={{color: 'green'}}><b>Expected Output</b></span>
134+
135+
```bash
136+
auth-server:
137+
Image: litmuschaos/litmusportal-auth-server:ci
138+
Ports: 3000/TCP, 3030/TCP
139+
Host Ports: 0/TCP, 0/TCP
140+
Environment Variables from:
141+
litmus-portal-admin-config ConfigMap Optional: false
142+
litmus-portal-admin-secret Secret Optional: false
143+
Environment:
144+
STRICT_PASSWORD_POLICY: false
145+
ADMIN_USERNAME: admin
146+
ADMIN_PASSWORD: litmus
147+
LITMUS_SVC_ENDPOINT: 127.0.0.1
148+
OIDC_ISSUER: [REDACTED]
149+
DEX_ENABLED: true
150+
DEX_OAUTH_CALLBACK_URL: [REDACTED]
151+
Mounts: <none>
152+
```
153+
124154
Go to http://litmusportal-frontend-service/auth/dex/login, you should be prompted with Google or GitHub login
125155

126156
![litmus-oauth-image](https://user-images.githubusercontent.com/31009634/135559389-c8cdf53c-76cf-4f9d-acaa-99014540f9cf.png)
127157

128158

129-
130159
## Resources
131160

132161
- [Dex OIDC Provider configurations](https://dexidp.io/docs/)

0 commit comments

Comments
 (0)