Skip to content

Commit fbd6141

Browse files
committed
zendesk support
1 parent ae49c7d commit fbd6141

24 files changed

+336
-53
lines changed

Gopkg.lock

Lines changed: 85 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@
3636
name = "google.golang.org/api"
3737

3838
[[constraint]]
39-
name = "gopkg.in/fsnotify.v1"
40-
version = "~1.2.0"
39+
name = "github.com/fsnotify/fsnotify"
40+
version = "~1.4.0"

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ oauth2_proxy
44
A reverse proxy and static file server that provides authentication using Providers (Google, GitHub, and others)
55
to validate accounts by email, domain or group.
66

7-
[![Build Status](https://secure.travis-ci.org/bitly/oauth2_proxy.svg?branch=master)](http://travis-ci.org/bitly/oauth2_proxy)
7+
[![Build Status](https://secure.travis-ci.org/topfreegames/oauth2_proxy.svg?branch=master)](http://travis-ci.org/topfreegames/oauth2_proxy)
88

99

1010
![Sign In Page](https://cloud.githubusercontent.com/assets/45028/4970624/7feb7dd8-6886-11e4-93e0-c9904af44ea8.png)
@@ -15,7 +15,7 @@ to validate accounts by email, domain or group.
1515

1616
## Installation
1717

18-
1. Download [Prebuilt Binary](https://github.com/bitly/oauth2_proxy/releases) (current release is `v2.2`) or build with `$ go get github.com/bitly/oauth2_proxy` which will put the binary in `$GOROOT/bin`
18+
1. Download [Prebuilt Binary](https://github.com/topfreegames/oauth2_proxy/releases) (current release is `v2.2`) or build with `$ go get github.com/topfreegames/oauth2_proxy` which will put the binary in `$GOROOT/bin`
1919
Prebuilt binaries can be validated by extracting the file and verifying it against the `sha256sum.txt` checksum file provided for each release starting with version `v2.3`.
2020
```
2121
sha256sum -c sha256sum.txt 2>&1 | grep OK
@@ -37,6 +37,7 @@ Valid providers are :
3737
* [GitHub](#github-auth-provider)
3838
* [GitLab](#gitlab-auth-provider)
3939
* [LinkedIn](#linkedin-auth-provider)
40+
* [Zendesk](#zendesk-auth-provider)
4041

4142
The provider can be selected using the `provider` configuration value.
4243

@@ -155,6 +156,13 @@ OpenID Connect is a spec for OAUTH 2.0 + identity that is implemented by many ma
155156
-cookie-secure=false
156157
-email-domain example.com
157158

159+
### Zendesk Auth Provider
160+
161+
1. Follow these steps to register Zendesk OAuth2 application: [Register your application with Zendesk](https://support.zendesk.com/hc/en-us/articles/203663836-Using-OAuth-authentication-with-your-application#topic_s21_lfs_qk).
162+
2. For "Redirect URLs", provide `https://internal.yourcompany.com/oauth2/callback`.
163+
3. Provide **Unique Identifier** (passed as `--client-id`) and take note of **Secret** (passed as `--client-secret`).
164+
3. Provide your subdomain via the `--zendesk-subdomain=<YOUR SUBDOMAIN>` option.
165+
158166
## Email Authentication
159167

160168
To authorize by email domain use `--email-domain=yourcompany.com`. To authorize individual email addresses use `--authenticated-emails-file=/path/to/file` with one email per line. To authorize all email addresses use `--email-domain=*`.

contrib/oauth2_proxy.cfg.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## OAuth2 Proxy Config File
2-
## https://github.com/bitly/oauth2_proxy
2+
## https://github.com/topfreegames/oauth2_proxy
33

44
## <addr>:<port> to listen on for HTTP/HTTPS clients
55
# http_address = "127.0.0.1:4180"

dist.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# build binary distributions for linux/amd64 and darwin/amd64
3-
set -e
3+
# set -e
44

55
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
66
echo "working dir $DIR"
@@ -24,7 +24,7 @@ for os in windows linux darwin; do
2424
fi
2525
BUILD=$(mktemp -d ${TMPDIR:-/tmp}/oauth2_proxy.XXXXXX)
2626
TARGET="oauth2_proxy-$version.$os-$arch.$goversion"
27-
FILENAME="oauth2_proxy-$version.$os-$arch$EXT"
27+
FILENAME="oauth2_proxy"
2828
GOOS=$os GOARCH=$arch CGO_ENABLED=0 \
2929
go build -ldflags="-s -w" -o $BUILD/$TARGET/$FILENAME || exit 1
3030
pushd $BUILD/$TARGET

main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func main() {
4646
flagSet.String("azure-tenant", "common", "go to a tenant-specific or common (tenant-independent) endpoint.")
4747
flagSet.String("github-org", "", "restrict logins to members of this organisation")
4848
flagSet.String("github-team", "", "restrict logins to members of this team")
49+
flagSet.String("zendesk-subdomain", "", "subdomain for Zendesk")
4950
flagSet.Var(&googleGroups, "google-group", "restrict logins to members of this google group (may be given multiple times).")
5051
flagSet.String("google-admin-email", "", "the google admin to impersonate for api calls")
5152
flagSet.String("google-service-account-json", "", "the path to the service account json credentials")

oauthproxy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import (
1414
"strings"
1515
"time"
1616

17-
"github.com/bitly/oauth2_proxy/cookie"
18-
"github.com/bitly/oauth2_proxy/providers"
1917
"github.com/mbland/hmacauth"
18+
"github.com/topfreegames/oauth2_proxy/cookie"
19+
"github.com/topfreegames/oauth2_proxy/providers"
2020
)
2121

2222
const SignatureHeader = "GAP-Signature"

oauthproxy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import (
1515
"testing"
1616
"time"
1717

18-
"github.com/bitly/oauth2_proxy/providers"
1918
"github.com/mbland/hmacauth"
2019
"github.com/stretchr/testify/assert"
20+
"github.com/topfreegames/oauth2_proxy/providers"
2121
)
2222

2323
func init() {

options.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import (
1313
"strings"
1414
"time"
1515

16-
"github.com/bitly/oauth2_proxy/providers"
1716
oidc "github.com/coreos/go-oidc"
1817
"github.com/mbland/hmacauth"
18+
"github.com/topfreegames/oauth2_proxy/providers"
1919
)
2020

2121
// Configuration Options that can be set by Command Line Flag, or Config File
@@ -37,6 +37,7 @@ type Options struct {
3737
GoogleGroups []string `flag:"google-group" cfg:"google_group"`
3838
GoogleAdminEmail string `flag:"google-admin-email" cfg:"google_admin_email"`
3939
GoogleServiceAccountJSON string `flag:"google-service-account-json" cfg:"google_service_account_json"`
40+
ZendeskSubdomain string `flag:"zendesk-subdomain" cfg:"zendesk_subdomain"`
4041
HtpasswdFile string `flag:"htpasswd-file" cfg:"htpasswd_file"`
4142
DisplayHtpasswdForm bool `flag:"display-htpasswd-form" cfg:"display_htpasswd_form"`
4243
CustomTemplatesDir string `flag:"custom-templates-dir" cfg:"custom_templates_dir"`
@@ -263,6 +264,8 @@ func parseProviderInfo(o *Options, msgs []string) []string {
263264
p.Configure(o.AzureTenant)
264265
case *providers.GitHubProvider:
265266
p.SetOrgTeam(o.GitHubOrg, o.GitHubTeam)
267+
case *providers.ZendeskProvider:
268+
p.Configure(o.ZendeskSubdomain)
266269
case *providers.GoogleProvider:
267270
if o.GoogleServiceAccountJSON != "" {
268271
file, err := os.Open(o.GoogleServiceAccountJSON)

providers/azure.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"errors"
55
"fmt"
66
"github.com/bitly/go-simplejson"
7-
"github.com/bitly/oauth2_proxy/api"
7+
"github.com/topfreegames/oauth2_proxy/api"
88
"log"
99
"net/http"
1010
"net/url"

0 commit comments

Comments
 (0)