The External Authorization policy forwards incoming client HTTP requests to an external gRPC or HTTP authorization service to determine if the client HTTP request is authorized to access the upstream service. If the request is authorized, Omni Gateway allows the request to pass to the upstream service. For unauthorized accesses, Omni Gateway returns a 403 forbidden request error.
To forward request headers, such as an authorization token header, from the client HTTP request to the authorization service, configure the Allowed Headers parameter. Additionally, for HTTP authorization servers, use the Headers to add parameter to inject new headers into the authorization request.
|
|
Omni Gateway sends headers to the authorization service encoded in bytes. To send headers encoded in utf8, set the environment variable FLEX_HEADER_RAW_VALUE_ENABLE=false.
|
The External Authorization policy can also modify the client HTTP request and response headers with additional information returned from the authorization service. For example, if an authorized user makes a request with an access token header that corresponds to a username, the authorization service can return a username header for Omni Gateway to append to the client HTTP request.
For gRPC authorization servers, if the authorization service returns headers with the authorization response, Omni Gateway either appends these headers to the client HTTP request or overwrites the header if it is present in the client request.
For HTTP authorization servers, you can configure what headers to append, overwrite, or ignore. Policies with an HTTP server configured can also modify the client response returned from the upstream service.
The External Authorization policy is an extension of the External Authorization filter native to Envoy. To learn more about the External Authorization filter, see External Authorization Filter. Not all External Authorization filter parameters are available to the External Authorization policy. To find what parameters are configurable, see Configuring Policy Parameters.
|
|
If other policies modify the incoming HTTP request, ensure that you order the policies depending on if these modification must be present before sending the request to the authorization service. For more information about ordering policies, see Ordering Policies.
|