@@ -8,8 +8,7 @@ individual accounts, or a whole google apps domain.
8[](http://travis-ci.org/bitly/google_auth_proxy)
8[](http://travis-ci.org/bitly/google_auth_proxy)
11−## Structure
11+## Architecture
15 _______ ___________________ __________
14 _______ ___________________ __________
@@ -18,17 +17,29 @@ individual accounts, or a whole google apps domain.
20 [google oauth2 api]
19 [google oauth2 api]
25+1. [Install Go](http://golang.org/doc/install)
26+2. install dependencies `$ go get github.com/bitly/go-simplejson`
27+3. clone the repository `$ git clone https://github.com/bitly/google_auth_proxy.git`
28+4. compile `$ cd google_auth_proxy && go build`
29+5. copy the built binary `google_auth_proxy` to `/usr/local/bin` (or wherever you want to run it from)
24−## Configuration
31+## OAuth Configuration
33+You will need to register an OAuth application with google, and configure it with Redirect URI(s) for the domain you
34+intend to run google_auth_proxy on.
26−1. visit to Google Api Console https://code.google.com/apis/console/
36+1. Visit to Google Api Console https://code.google.com/apis/console/
272. under "API Access", choose "Create an OAuth 2.0 Client ID"
372. under "API Access", choose "Create an OAuth 2.0 Client ID"
283. Edit the application settings, and list the Redirect URI(s) where you will run your application. For example:
383. Edit the application settings, and list the Redirect URI(s) where you will run your application. For example:
29`https://internalapp.yourcompany.com/oauth2/callback`
39`https://internalapp.yourcompany.com/oauth2/callback`
40+4. Make a note of the Client ID, and Client Secret and specify those values as command line arguments
31−## Usage
42+## Command Line Options
34Usage of ./google_auth_proxy:
45Usage of ./google_auth_proxy:
@@ -46,13 +57,11 @@ Usage of ./google_auth_proxy:
46 -version=false: print version string
57 -version=false: print version string
49−Unauthenticated requests will be redirected to `/oauth2/sign_in` to start the sign-in process.
61+## Example Configuration
54−To run google_auth_proxy as a reverse proxy on port 4180 authenticating requests for an application running
63+To run `google_auth_proxy` as a reverse proxy on port `4180` authenticating requests for an application running
55−on port 8080 at internal.yourcompany.com you would use
64+on port `8080` at `http://internal.yourcompany.com/` you would use
58./google_auth_proxy \
67./google_auth_proxy \
@@ -64,7 +73,7 @@ on port 8080 at internal.yourcompany.com you would use
64 --client-secret=...
73 --client-secret=...
67−An example Nginx config to listen on ssl (port 443) and forward requests to port 4180 would be
76+An example Nginx config to listen on ssl (port 443) and forward requests to port google_auth_proxy on port 4180 would be
@@ -86,7 +95,9 @@ server {
89−## Documentation
98+## Endpoint Documentation
100+Google auth proxy responds directly to the following endpoints. All other endpoints will be authenticated.
91* /oauth2/sign_in - the login page, which also doubles as a sign out page (it clears cookies)
102* /oauth2/sign_in - the login page, which also doubles as a sign out page (it clears cookies)
92* /oauth2/start - a URL that will redirect to start the oauth cycle
103* /oauth2/start - a URL that will redirect to start the oauth cycle