A proof-of-concept deployment to showcase Envoy's OAuth2 filter with Google's OAuth2 API. The OAuth2 filter is an alpha feature under active development.
- Create a new OAuth client ID and secret under the credentials section for your API project (or create a new one, if necessary) at Google's API Console.
- Add the Client ID to
client_idinenvoy/envoy.yamland the client secret toenvoy/token-secret.yaml. - Make sure you add the
redirect_urifromenvoy/envoy.yamlto the list of authorized redirect URIs for your Google OAuth client. - Add the
openidscope to the OAuth consent screen. - To test your setup, verify you have added at least one test user with a Google account you have access to.
- Adapt the configuration (hosts, ports, routes, ...) of
envoy/envoy.yamlor of any Dockerfile to your setup if/as needed. - Generate an HMAC key and insert it into
envoy/hmac-secret.yaml:head -c 32 /dev/urandom | base64
The sample code uses docker-compose and consists of two services:
-
envoy: This container runs the officialenvoyproxy/envoy-devimage. Make sure it includes @andreyprezotto's pull request if you're not using thelatesttag. -
upstream: A tiny Python service which prints a success message and the request headers.