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_id
inenvoy/envoy.yaml
and the client secret toenvoy/token-secret.yaml
. - Make sure you add the
redirect_uri
fromenvoy/envoy.yaml
to the list of authorized redirect URIs for your Google OAuth client. - Add the
openid
scope 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.yaml
or 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-dev
image. Make sure it includes @andreyprezotto's pull request if you're not using thelatest
tag. -
upstream
: A tiny Python service which prints a success message and the request headers.