Skip to content
This repository was archived by the owner on Jan 24, 2019. It is now read-only.
This repository was archived by the owner on Jan 24, 2019. It is now read-only.

Forwarding Google OAuth user information through nginx #420

@patrickfuller

Description

@patrickfuller

I'm running oauth2_proxy and nginx in two docker containers, and it's working great as an authentication layer. However, I don't know how to reliably forward google user information (full name, profile picture) through to the endpoint.

In my oauth2_proxy config file, I have:

pass_user_headers = true
pass_host_header = true
pass_access_token = true
set_xauthrequest = true

In nginx, I have:

auth_request_set $user $upstream_http_x_auth_request_user;
auth_request_set $email $upstream_http_x_auth_request_email;
proxy_set_header Host $host;
proxy_set_header X-Email $email;
proxy_set_header X-Real-IP $remote_addr;
auth_request_set $auth_cookie $upstream_http_set_cookie;
add_header Set-Cookie $auth_cookie;

The user headers help, but are not all the information I'm looking for.

I could GET the desired info with an access token, but the pass_access_token doesn't work as is. Likely because I'm not forwarding it through nginx, but I can't find any documentation on appending the X-Forwarded-Access-Token.

What am I missing?

Thanks,
Pat

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions