diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2016-06-06 01:12:28 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2016-06-06 01:12:28 +0100 |
commit | 5166bbbf3e084f7b6ab9034f2f7590c1031bc266 (patch) | |
tree | cded438fa95419b615ac5c0aeb98e9c3f0dba7dc /server | |
parent | a52d19e9e78d08643ffd4aee0483515d8bae2939 (diff) | |
parent | f456753248612222ad9bb6f3de74b7e28771470e (diff) |
Merge pull request #15 from nsheridan/auth_state
Save oauth 'state' identifier in the client
Diffstat (limited to 'server')
-rw-r--r-- | server/auth/github/github.go | 1 | ||||
-rw-r--r-- | server/auth/github/github_test.go | 1 | ||||
-rw-r--r-- | server/auth/google/google.go | 1 | ||||
-rw-r--r-- | server/auth/google/google_test.go | 1 | ||||
-rw-r--r-- | server/auth/provider.go | 1 |
5 files changed, 0 insertions, 5 deletions
diff --git a/server/auth/github/github.go b/server/auth/github/github.go index d7a57af..7904e26 100644 --- a/server/auth/github/github.go +++ b/server/auth/github/github.go @@ -78,7 +78,6 @@ func (c *Config) Revoke(token *oauth2.Token) error { func (c *Config) StartSession(state string) *auth.Session { return &auth.Session{ AuthURL: c.config.AuthCodeURL(state), - State: state, } } diff --git a/server/auth/github/github_test.go b/server/auth/github/github_test.go index f50d134..1d6b801 100644 --- a/server/auth/github/github_test.go +++ b/server/auth/github/github_test.go @@ -42,7 +42,6 @@ func TestStartSession(t *testing.T) { p, _ := newGithub() s := p.StartSession("test_state") - a.Equal(s.State, "test_state") a.Contains(s.AuthURL, "github.com/login/oauth/authorize") a.Contains(s.AuthURL, "state=test_state") a.Contains(s.AuthURL, fmt.Sprintf("client_id=%s", oauthClientID)) diff --git a/server/auth/google/google.go b/server/auth/google/google.go index 7c9b930..e2c6724 100644 --- a/server/auth/google/google.go +++ b/server/auth/google/google.go @@ -90,7 +90,6 @@ func (c *Config) Revoke(token *oauth2.Token) error { func (c *Config) StartSession(state string) *auth.Session { return &auth.Session{ AuthURL: c.config.AuthCodeURL(state, oauth2.SetAuthURLParam("hd", c.domain)), - State: state, } } diff --git a/server/auth/google/google_test.go b/server/auth/google/google_test.go index 4d41986..9970c21 100644 --- a/server/auth/google/google_test.go +++ b/server/auth/google/google_test.go @@ -44,7 +44,6 @@ func TestStartSession(t *testing.T) { p, err := newGoogle() a.NoError(err) s := p.StartSession("test_state") - a.Equal(s.State, "test_state") a.Contains(s.AuthURL, "accounts.google.com/o/oauth2/auth") a.Contains(s.AuthURL, "state=test_state") a.Contains(s.AuthURL, fmt.Sprintf("hd=%s", domain)) diff --git a/server/auth/provider.go b/server/auth/provider.go index d7d5ed5..06dc1c9 100644 --- a/server/auth/provider.go +++ b/server/auth/provider.go @@ -16,7 +16,6 @@ type Provider interface { type Session struct { AuthURL string Token *oauth2.Token - State string } // Authorize obtains data from the provider and retains an access token that |