1// Copyright 2016 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// Package microsoft provides constants for using OAuth2 to access Windows Live ID.
6package microsoft // import "golang.org/x/oauth2/microsoft"
7
8import (
9	"golang.org/x/oauth2"
10)
11
12// LiveConnectEndpoint is Windows's Live ID OAuth 2.0 endpoint.
13var LiveConnectEndpoint = oauth2.Endpoint{
14	AuthURL:  "https://login.live.com/oauth20_authorize.srf",
15	TokenURL: "https://login.live.com/oauth20_token.srf",
16}
17
18// AzureADEndpoint returns a new oauth2.Endpoint for the given tenant at Azure Active Directory.
19// If tenant is empty, it uses the tenant called `common`.
20//
21// For more information see:
22// https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols#endpoints
23func AzureADEndpoint(tenant string) oauth2.Endpoint {
24	if tenant == "" {
25		tenant = "common"
26	}
27	return oauth2.Endpoint{
28		AuthURL:  "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/authorize",
29		TokenURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/token",
30	}
31}
32