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
The above command should produce the following output:
@@ -116,7 +116,7 @@ kubectl apply -f - <<EOF
116
116
apiVersion: enterprise.gloo.solo.io/v1
117
117
kind: AuthConfig
118
118
metadata:
119
-
name: passthrough-auth
119
+
name: grpc-passthrough-auth
120
120
namespace: gloo-system
121
121
spec:
122
122
configs:
@@ -141,12 +141,12 @@ kubectl apply -f - <<EOF
141
141
apiVersion: gateway.solo.io/v1
142
142
kind: VirtualService
143
143
metadata:
144
-
name: auth-tutorial
144
+
name: grpc-auth-tutorial
145
145
namespace: gloo-system
146
146
spec:
147
147
virtualHost:
148
148
domains:
149
-
- 'foo'
149
+
- 'foo-grpc'
150
150
routes:
151
151
- matchers:
152
152
- prefix: /
@@ -156,11 +156,11 @@ spec:
156
156
name: json-upstream
157
157
namespace: gloo-system
158
158
options:
159
-
autoHostRewrite: true
159
+
autoHostRewrite: true
160
160
options:
161
161
extauth:
162
162
configRef:
163
-
name: passthrough-auth
163
+
name: grpc-passthrough-auth
164
164
namespace: gloo-system
165
165
EOF
166
166
{{< /highlight >}}
@@ -193,19 +193,19 @@ For more information on how Gloo Gateway handles observability and metrics, view
193
193
The virtual service that we have created should now be secured using our external authentication service. To test this, we can try our original command, and the request should not be allowed through because of missing authentication.
The output should be empty. In fact, we can see the 403 (Unauthorized) HTTP status code if we run the same curl, but with a modification to print the http code to the console.
The sample gRPC authentication service has been implemented such that any request with the header `authorization: authorize me` will be authorized. We can easily add this header to our curl request as follows:
@@ -223,7 +223,7 @@ You can configure the Gloo ExtAuth server to retry the connection to the passthr
223
223
apiVersion: enterprise.gloo.solo.io/v1
224
224
kind: AuthConfig
225
225
metadata:
226
-
name: passthrough-auth
226
+
name: grpc-passthrough-auth
227
227
namespace: gloo-system
228
228
spec:
229
229
configs:
@@ -262,7 +262,7 @@ State from other auth steps is sent to the passthrough service via [CheckRequest
262
262
263
263
State from the passthrough service can be sent to other auth steps via [CheckResponse DynamicMetadata](https://github.com/envoyproxy/envoy/blob/50e722cbb0486268c128b0f1d0ef76217387799f/api/envoy/service/auth/v3/external_auth.proto#L126) under a unique key: `solo.auth.passthrough`.
264
264
265
-
### Passing in custom configuration to Passthrough Auth Service from AuthConfigs
265
+
### Passing custom configuration to the Passthrough Auth Service from AuthConfigs
266
266
{{% notice note %}}
267
267
This feature was introduced with **Gloo Gateway Enterprise**, release 1.6.15. If you are using an earlier version, this will not work.
268
268
{{% /notice %}}
@@ -274,7 +274,7 @@ kubectl apply -f - <<EOF
274
274
apiVersion: enterprise.gloo.solo.io/v1
275
275
kind: AuthConfig
276
276
metadata:
277
-
name: passthrough-auth
277
+
name: grpc-passthrough-auth
278
278
namespace: gloo-system
279
279
spec:
280
280
configs:
@@ -292,6 +292,9 @@ EOF
292
292
293
293
This config is accessible via the [CheckRequest FilterMetadata](https://github.com/envoyproxy/envoy/blob/50e722cbb0486268c128b0f1d0ef76217387799f/api/envoy/service/auth/v3/external_auth.proto#L36) under a unique key: `solo.auth.passthrough.config`.
294
294
295
+
## Pass request body to the Passthrough Auth Service
296
+
In order for the body to be passed through to the auth service, the `settings.extauth.requestBody` must be set in the Gloo Gateway Settings CRD so that the request body is buffered and sent to the ext-auth service. Headers are always passed through.
297
+
295
298
## Summary
296
299
297
300
In this guide, we installed Gloo Gateway Enterprise and created an unauthenticated Virtual Service that routes requests to a static upstream. We spun up an example gRPC authentication service that uses a simple header for authentication. We then created an `AuthConfig` and configured it to use Passthrough Auth, pointing it to the IP of our example gRPC service. In doing so, we instructed gloo to pass through requests from the external authentication server to the grpc authentication service provided by the user.
# Set a connection timeout to external service, default is 5 seconds
123
123
connectionTimeout: 3s
124
124
EOF
@@ -136,12 +136,12 @@ kubectl apply -f - <<EOF
136
136
apiVersion: gateway.solo.io/v1
137
137
kind: VirtualService
138
138
metadata:
139
-
name: auth-tutorial
139
+
name: http-auth-tutorial
140
140
namespace: gloo-system
141
141
spec:
142
142
virtualHost:
143
143
domains:
144
-
- 'foo'
144
+
- 'foo-http'
145
145
routes:
146
146
- matchers:
147
147
- prefix: /
@@ -151,11 +151,11 @@ spec:
151
151
name: json-upstream
152
152
namespace: gloo-system
153
153
options:
154
-
autoHostRewrite: true
154
+
autoHostRewrite: true
155
155
options:
156
156
extauth:
157
157
configRef:
158
-
name: passthrough-auth
158
+
name: http-passthrough-auth
159
159
namespace: gloo-system
160
160
EOF
161
161
{{< /highlight >}}
@@ -189,7 +189,7 @@ If the auth config has been received successfully, you should see the log line:
189
189
The virtual service that we have created should now be secured using our external authentication service. To test this, we can try our original command, and the request should not be allowed through because of missing authentication.
In fact, if we check the logs of our sample http auth service, we see the following message:
@@ -205,7 +205,7 @@ kubectl apply -f - <<EOF
205
205
apiVersion: enterprise.gloo.solo.io/v1
206
206
kind: AuthConfig
207
207
metadata:
208
-
name: passthrough-auth
208
+
name: http-passthrough-auth
209
209
namespace: gloo-system
210
210
spec:
211
211
configs:
@@ -226,7 +226,7 @@ The sample Http authentication service has been implemented such that any reques
226
226
passthrough auth to use the `/auth` path with the http auth server and to passthrough `Authorization` header. We can now add this header to our curl request as follows:
@@ -239,7 +239,7 @@ For more information about configuration options, see the [API docs]({{< version
239
239
apiVersion: enterprise.gloo.solo.io/v1
240
240
kind: AuthConfig
241
241
metadata:
242
-
name: passthrough-auth
242
+
name: http-passthrough-auth
243
243
namespace: gloo-system
244
244
spec:
245
245
configs:
@@ -248,7 +248,7 @@ spec:
248
248
# Url of the http auth server to use for auth
249
249
# This can include path, and can also use https.
250
250
# In order to use a https passthrough server, provide the cert in the HTTPS_PASSTHROUGH_CA_CERT environment variable to the ext-auth-service pod as a base64-encoded string.
Copy file name to clipboardexpand all lines: docs/content/reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/enterprise/options/extauth/v1/extauth.proto.sk.md
0 commit comments