Skip to content

Commit d8e98fc

Browse files
committed
Creating documentation of Authorization Configuration
1 parent af3e9a6 commit d8e98fc

File tree

8 files changed

+94
-1
lines changed

8 files changed

+94
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The plugin allows user to login in GoCD using an Keycloak account. It is impleme
44

55
# Installation
66

7-
Installation documentation available [here](INSTALL.md).
7+
Installation documentation available [here](docs/INSTALL.md).
88

99
# Capabilities
1010

docs/AUTHORIZATION_CONFIGURATION.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Authorization Configuration
2+
3+
The `Authorization Configuration` is used to configure a connection to an Keycloak Authorization server. The configuration is later used by the plugin to authorize a user or search for them in the Keycloak. You can also configure multiple Keycloak servers by creating multiple authorization configurations.
4+
5+
1. Login to the GoCD server as an administrator and navigate to **_Admin_** _>_ **_Security_** _>_ **_Authorization Configuration_**.
6+
2. Click on **_Add_** to create a new authorization configuration.
7+
3. Provide a unique identifier for this authorization configuration and select `Keycloak oauth authorization plugin` as the **Plugin**.
8+
9+
4. **Keycloak Endpoint (`Mandatory`):** Specify your Keycloak Endpoint.
10+
11+
![Keycloak Endpoint](images/keycloak_endpoint.png?raw=true "Keycloak Endpoint")
12+
13+
```xml
14+
<property>
15+
<key>KeycloakEndpoint</key>
16+
<value>https://auth.example.com</value>
17+
</property>
18+
```
19+
> If you customize the Keycloak endpoint, Ex.: remove /auth context, you need to adapt the plugin.
20+
21+
5. **Keycloak Realm (`Mandatory`):** Specify your Keycloak Realm.
22+
23+
![Realm](images/keycloak_realm.png?raw=true "Realm")
24+
25+
```xml
26+
<property>
27+
<key>KeycloakRealm</key>
28+
<value>master</value>
29+
</property>
30+
```
31+
32+
6. **Keycloak Client ID (`Mandatory`):** Specify your Keycloak Client ID.
33+
34+
![Client ID](images/keycloak_clientid.png?raw=true "Client ID")
35+
36+
```xml
37+
<property>
38+
<key>ClientId</key>
39+
<value>gocd-agent</value>
40+
</property>
41+
```
42+
43+
7. **Keycloak Client Secret Key (`Mandatory`):** Specify your Keycloak Secret Key.
44+
45+
![Secret Key](images/keycloak_secretkey.png?raw=true "Secret Key")
46+
47+
```xml
48+
<property>
49+
<key>ClientSecret</key>
50+
<encryptedValue>YOUR_SECRET</encryptedValue>
51+
</property>
52+
```
53+
54+
8. Click on **_Check connection_** to verify your configuration. The plugin will establish a connection with `Keycloak server` using the configuration and will return the verification status.
55+
56+
9. Once check connection succeeds, click on **_Save_** to save the authorization configuration.
57+
58+
#### Example authorization configuration
59+
60+
![Authorization configuration](images/keycloak_config.png?raw=true "Authorization configuration")
61+
62+
<hr/>
63+
64+
**Alternatively, the configuration can be added directly to the GoCD config XML using the `<authConfig>` tag. It should be added under `<security/>` tag as described in the following example:**
65+
66+
```xml
67+
<security>
68+
<authConfigs>
69+
<authConfig id="Keycloak" pluginId="cd.go.authorization.keycloak">
70+
<property>
71+
<key>KeycloakEndpoint</key>
72+
<value>https://auth.example.com</value>
73+
</property>
74+
<property>
75+
<key>KeycloakRealm</key>
76+
<value>master</value>
77+
</property>
78+
<property>
79+
<key>ClientId</key>
80+
<value>gocd-agent</value>
81+
</property>
82+
<property>
83+
<key>ClientSecret</key>
84+
<encryptedValue>your_secret_key</encryptedValue>
85+
</property>
86+
</authConfig>
87+
</authConfigs>
88+
<admins>
89+
<user>[email protected]</user>
90+
</admins>
91+
</security>
92+
```

INSTALL.md renamed to docs/INSTALL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and restart the server. The `GO_SERVER_DIR` is usually `/var/lib/go-server` on L
1212
on Windows.
1313

1414
## Configuration
15+
Provide details of the Keycloak server to connect to via an [Authorization Configuration](AUTHORIZATION_CONFIGURATION.md).
1516

1617
### Configure Keycloak Client
1718

docs/images/keycloak_clientid.png

10.4 KB
Loading

docs/images/keycloak_config.png

52.5 KB
Loading

docs/images/keycloak_endpoint.png

10.4 KB
Loading

docs/images/keycloak_realm.png

7.13 KB
Loading

docs/images/keycloak_secretkey.png

16.9 KB
Loading

0 commit comments

Comments
 (0)