Skip to content

Commit 09bba27

Browse files
rumyantsevarakyll
authored andcommitted
microsoft: improve azure active directory endpoint
Rename AzureActiveDirectoryEndpoint to AzureADEndpoint. Add default tenant ("common"). Delete azure package (azure.Endpoint duplicates microsoft.AzureADEndpoint). Change-Id: I48a7679ffddd984f5744a64edfa4df958c18ed66 Reviewed-on: https://go-review.googlesource.com/83696 Reviewed-by: JBD <[email protected]>
1 parent 00dc701 commit 09bba27

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

azure/azure.go

-16
This file was deleted.

microsoft/microsoft.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@ var LiveConnectEndpoint = oauth2.Endpoint{
1515
TokenURL: "https://login.live.com/oauth20_token.srf",
1616
}
1717

18-
// AzureActiveDirectoryEndpoint returns a new oauth2.Endpoint for the given tenant at Azure Active Directory.
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`.
1920
//
2021
// For more information see:
2122
// https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols#endpoints
22-
func AzureActiveDirectoryEndpoint(tenant string) oauth2.Endpoint {
23+
func AzureADEndpoint(tenant string) oauth2.Endpoint {
24+
if tenant == "" {
25+
tenant = "common"
26+
}
2327
return oauth2.Endpoint{
2428
AuthURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/authorize",
2529
TokenURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/token",

0 commit comments

Comments
 (0)