git.iko.soy/typeable/oauth2-proxy
on master help sign in
readme updates
37ca0fbJehiah Czebotar
README.md+25−14
@@ -8,8 +8,7 @@ individual accounts, or a whole google apps domain.
8[![Build Status](https://secure.travis-ci.org/bitly/google_auth_proxy.png?branch=master)](http://travis-ci.org/bitly/google_auth_proxy)
8[![Build Status](https://secure.travis-ci.org/bitly/google_auth_proxy.png?branch=master)](http://travis-ci.org/bitly/google_auth_proxy)
9
9
10
10
11−## Structure
11+## Architecture
12−
13
12
14```
13```
15 _______ ___________________ __________
14 _______ ___________________ __________
@@ -18,17 +17,29 @@ individual accounts, or a whole google apps domain.
18 ||
17 ||
19 \/
18 \/
20 [google oauth2 api]
19 [google oauth2 api]
21−
22```
20```
23
21
22+
23+## Installation
24+
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)
30+
24−## Configuration
31+## OAuth Configuration
25−
32+
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.
35+
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
30
41
31−## Usage
42+## Command Line Options
32
43
33```
44```
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
47```
58```
48
59
49−Unauthenticated requests will be redirected to `/oauth2/sign_in` to start the sign-in process.
50
60
61+## Example Configuration
51
62
52−## Example
53−
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
56
65
57```bash
66```bash
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=...
65```
74```
66
75
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
68
77
69```
78```
70server {
79server {
@@ -86,7 +95,9 @@ server {
86}
95}
87```
96```
88
97
89−## Documentation
98+## Endpoint Documentation
99+
100+Google auth proxy responds directly to the following endpoints. All other endpoints will be authenticated.
90
101
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