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
Copy file name to clipboardExpand all lines: README.md
+93-7Lines changed: 93 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,22 @@
2
2
3
3
This repo shows how to protect your APIs using the Kong API Gateway working as PEP proxy with a Keycloak integration for authentication and authorization of incoming requests.
The source code of all plugins must be in the respective folder, meaning:
@@ -51,9 +67,8 @@ Creating new routes for a given service is fairly simple. Just like creating a n
51
67
3. Click on 'Other' and then select 'Add Plugin' option on the oidc plugin
52
68
Configure the oidc plugins as shown in the image below with the configurations as per your client.
53
69
54
-

70
+

55
71
56
-
For client creation in Keycloak, please refer to [this guide](kongkeycloak.pdf).
57
72
58
73
### 3.4 Configure custom plugins
59
74
@@ -63,15 +78,22 @@ To add any plugin, we follow the same procedure as done before with the OIDC plu
63
78
64
79
#### 3.4.1 Configuring Milti-Tenancy Plugin
65
80
66
-
You can add the plugin and global, service or at route level. Select the plugin in the 'Add Plugin' section.
81
+
You can add the plugin at global, service or at route level. Select the plugin in the 'Add Plugin' section.
67
82
68
83
`tenant name` (required) field defines the custom header name. It can be renamed as per your custom requirement. This field will be checked against the token presented in the request.
69
-
70
84

71
85
86
+
Ex: As shown in the image above, we have set the tenant name to `fiware-service`. In the incoming request to kong, it is mandatory to have a request header with name "fiware-service" and the value set in keycloak for the given user.
87
+
88
+
*Note*: See section [4.5](#4-keycloak-configurations) for more details to configure keycloak.
Similar to the multi-tenancy plugin, this plugin can be used at global, service or routes level.
96
+
When `use custom roles` is disabled, the plugin expects the role in the form *tenantname_role*. Ex: if the tenant name is set to *fiware-service:app*, then the accepted roles are `app_read`, `app_write` and `app_admin`.
75
97
76
98
-`tenant name`(required)(String) field defines the custom header name. It can be renamed as per your custom requirement.
77
99
@@ -82,19 +104,83 @@ Similar to the multi-tenancy plugin, this plugin can be used at global, service
82
104
-`admin role` (depends on 'use custom roles')(String) Pre-defined role needed for DELETE requests.
83
105
-`include client role` (optional)(Bool) field indicated whether to use client roles or user roles configured in Keycloak.
84
106
-`client name` (depends on include client role)(String) field is used to specify the name of the client.
85
-
107
+
108
+
*Note*: See section [4.6](#4-keycloak-configurations) for more details to configure keycloak.
86
109

87
110
111
+
#### 3.4.3 Configuring scope-checker Plugin
112
+
113
+
*Note*: This plugin is intended for future use with release of oriod-ld.
114
+
With this plugin its possible to validate the scopes sent as headers by the client against the permission given to the client in Keycloak. Make sure the headers and token attributes are set with the name as `scopes`
115
+
116
+
-`plus allowed` (Boolean) field used to decide plus(+) wildcard entries in scope
0 commit comments