Skip to content

Commit 6544e4d

Browse files
author
Bruno Barin
committed
Improved documentation guide on how to configure Litmus with Dex OIDC
Signed-off-by: Bruno Barin <[email protected]>
1 parent ad8b497 commit 6544e4d

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

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

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ Before deploying LitmusChaos, make sure the following items are there
2323
- [Deployed ChaosCenter](../getting-started/installation.md)
2424

2525
- Atleast one of the following
26-
- Google Oauth credentials
27-
- GitHub Oauth credentials
26+
- Google Oauth credentials
27+
- GitHub Oauth credentials
2828

2929
## Deploy Dex OIDC provider
3030

@@ -35,18 +35,17 @@ Make sure you have your Google and GitHub Client credentials ready, if you do no
3535
- [Guide to generating Google Oauth Client Credentials](https://support.google.com/cloud/answer/6158849?hl=en#zippy=)
3636
- [Guide to generating GitHub OAuth Client Credentials](https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app)
3737

38-
3938
### Configuring Dex OIDC provider
4039

41-
4240
```bash
43-
curl https://raw.githubusercontent.com/litmuschaos/litmus/8d025a2f3101990a1acc002612fbe7281dcbfb4d/litmus-portal/dex-server/dex-deployment.yaml --output dex-deployment.yaml
41+
curl https://raw.githubusercontent.com/litmuschaos/litmus/master/litmus-portal/dex-server/dex-deployment.yaml --output dex-deployment.yaml
4442
```
4543

4644
1. Open the file with your favorite text-editor
4745
2. You will find the following `config-map` with some data, replace your data as the comments suggests
46+
4847
```yaml
49-
issuer: http://<NODE_IP>:32000 # Replace your NODE_IP here
48+
issuer: http://<NODE_IP>:32000 # Replace with the DEX URL
5049
storage:
5150
type: kubernetes
5251
config:
@@ -58,6 +57,7 @@ curl https://raw.githubusercontent.com/litmuschaos/litmus/8d025a2f3101990a1acc00
5857
redirectURIs:
5958
- '/auth/dex/callback'
6059
- 'http://localhost:8080/auth/dex/callback' # Included for local testing purposes
60+
- 'http://<LITMUS_PORTAL_FRONTEND>/auth/dex/callback' # Replace with the Litmus Portal Frontend callback
6161
name: 'LitmusPortalAuthBackend'
6262
secret: ZXhhbXBsZS1hcHAtc2VjcmV0
6363
oauth2:
@@ -69,14 +69,14 @@ curl https://raw.githubusercontent.com/litmuschaos/litmus/8d025a2f3101990a1acc00
6969
config:
7070
clientID: # Add your Google Client ID here
7171
clientSecret: # Add your Google Client Secret here
72-
redirectURI: http://<NODE_IP>:32000 # Replace your NODE_IP here
72+
redirectURI: http://<NODE_IP>:32000 # Replace with the DEX URL
7373
- type: github
7474
id: github
7575
name: GitHub
7676
config:
7777
clientID: # Add your GitHub Client ID here
7878
clientSecret: # Add your GitHub Client Secret here
79-
redirectURI: http://<NODE_IP>:32000/callback # Replace your NODE_IP here
79+
redirectURI: http://<NODE_IP>:32000/callback # Replace with the DEX URL
8080
```
8181
8282
**Note: The Dex OIDC provider runs at `NODE_IP:32000` by default**
@@ -103,30 +103,32 @@ litmusportal-server-9c4d85f57-5r6km 2/2 Running 0
103103
mongo-0 1/1 Running 0 5m57s
104104
```
105105

106-
107106
### Configuring `litmusportal-server` to enable Dex features
108107

109108
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
110109

111110
- `OIDC_ISSUER`: The place where the Dex OIDC lives, i.e `NODE_IP:32000`
112111
- `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
112+
- `DEX_OAUTH_CALLBACK_URL`: This is the url that will be called back after user completes its authentication, this will be the litmusportal-frontend service
113+
- `DEX_OAUTH_CLIENT_ID`: The client ID defined at the DEX server to allow it act on behalf of Litmus, i.e: `LitmusPortalAuthBackend`
114+
- `DEX_OAUTH_CLIENT_SECRET`: The client secret defined at the DEX server, i.e: `ZXhhbXBsZS1hcHAtc2VjcmV0`
114115

115-
Set your variables using
116+
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_SERVER="true", OIDC_ISSUER=<REPLACE_NODE_IP>:32000, DEX_OAUTH_CALLBACK_URL=<REPLACE_litmusportal_frontend_Service>/callback,
120+
DEX_OAUTH_CLIENT_ID="LitmusPortalAuthBackend",
121+
DEX_OAUTH_CLIENT_SECRET="ZXhhbXBsZS1hcHAtc2VjcmV0"
119122
```
123+
120124
Your litmusportal-server pod will be restarted and Dex features will be enabled!
121125

122126
### Verifying if OAuth2 is enabled
123127

124-
Go to http://litmusportal-frontend-service/auth/dex/login, you should be prompted with Google or GitHub login
128+
Go to <http://litmusportal-frontend-service/auth/dex/login>, you should be prompted with Google or GitHub login
125129

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

128-
129-
130132
## Resources
131133

132134
- [Dex OIDC Provider configurations](https://dexidp.io/docs/)
@@ -137,4 +139,3 @@ Go to http://litmusportal-frontend-service/auth/dex/login, you should be prompte
137139
- [Connect External ChaosAgents to ChaosCenter](../user-guides/chaosagents-installation.md)
138140
- [Setup Endpoints and Access ChaosCenter without Ingress](../user-guides/setup-without-ingress.md)
139141
- [Setup Endpoints and Access ChaosCenter with Ingress](../user-guides/setup-with-ingress.md)
140-

0 commit comments

Comments
 (0)