microsoft: add azure active directory endpoint

Relevant Azure AD API documentation is here: https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols#endpoints

Fixes #257

Change-Id: Ia4fb136bbaa9d4445cd098f354070f16ace3b24b
Reviewed-on: https://go-review.googlesource.com/82315
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Elena Grahovac 2017-12-06 21:45:08 +01:00 committed by Brad Fitzpatrick
parent ea8c6730ed
commit 6a2004c890
1 changed files with 11 additions and 0 deletions

View File

@ -14,3 +14,14 @@ var LiveConnectEndpoint = oauth2.Endpoint{
AuthURL: "https://login.live.com/oauth20_authorize.srf", AuthURL: "https://login.live.com/oauth20_authorize.srf",
TokenURL: "https://login.live.com/oauth20_token.srf", TokenURL: "https://login.live.com/oauth20_token.srf",
} }
// AzureActiveDirectoryEndpoint returns a new oauth2.Endpoint for the given tenant at Azure Active Directory.
//
// For more information see:
// https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols#endpoints
func AzureActiveDirectoryEndpoint(tenant string) oauth2.Endpoint {
return oauth2.Endpoint{
AuthURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/authorize",
TokenURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/token",
}
}