diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2018-08-20 17:18:27 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2018-08-20 17:18:27 +0100 |
commit | f906c9ba422eb720514721b559c01f840ca34a0c (patch) | |
tree | c7a8b0d4df7159b9b4ed959508b668c8f7e1c79d /server/auth/microsoft | |
parent | 87ae7c73ebe05f777e23087b1550d2cab42746ff (diff) |
Remove authprovider.Session
Diffstat (limited to 'server/auth/microsoft')
-rw-r--r-- | server/auth/microsoft/microsoft.go | 10 | ||||
-rw-r--r-- | server/auth/microsoft/microsoft_test.go | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/server/auth/microsoft/microsoft.go b/server/auth/microsoft/microsoft.go index 49d9b82..8463ccf 100644 --- a/server/auth/microsoft/microsoft.go +++ b/server/auth/microsoft/microsoft.go @@ -175,12 +175,10 @@ func (c *Config) Revoke(token *oauth2.Token) error { } // StartSession retrieves an authentication endpoint from Microsoft. -func (c *Config) StartSession(state string) *auth.Session { - return &auth.Session{ - AuthURL: c.config.AuthCodeURL(state, - oauth2.SetAuthURLParam("hd", c.tenant), - oauth2.SetAuthURLParam("prompt", "login")), - } +func (c *Config) StartSession(state string) string { + return c.config.AuthCodeURL(state, + oauth2.SetAuthURLParam("hd", c.tenant), + oauth2.SetAuthURLParam("prompt", "login")) } // Exchange authorizes the session and returns an access token. diff --git a/server/auth/microsoft/microsoft_test.go b/server/auth/microsoft/microsoft_test.go index c2c2c17..e362ef9 100644 --- a/server/auth/microsoft/microsoft_test.go +++ b/server/auth/microsoft/microsoft_test.go @@ -57,7 +57,7 @@ func TestStartSession(t *testing.T) { p, err := newMicrosoft() a.NoError(err) s := p.StartSession("test_state") - a.Contains(s.AuthURL, fmt.Sprintf("login.microsoftonline.com/%s/oauth2/v2.0/authorize", tenant)) + a.Contains(s, fmt.Sprintf("login.microsoftonline.com/%s/oauth2/v2.0/authorize", tenant)) } func newMicrosoft() (*Config, error) { |