From f906c9ba422eb720514721b559c01f840ca34a0c Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Mon, 20 Aug 2018 17:18:27 +0100 Subject: Remove authprovider.Session --- server/auth/microsoft/microsoft.go | 10 ++++------ server/auth/microsoft/microsoft_test.go | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'server/auth/microsoft') 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) { -- cgit v1.2.3