aboutsummaryrefslogtreecommitdiff
path: root/server/auth/microsoft
diff options
context:
space:
mode:
Diffstat (limited to 'server/auth/microsoft')
-rw-r--r--server/auth/microsoft/microsoft.go10
-rw-r--r--server/auth/microsoft/microsoft_test.go2
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) {