diff --git a/microsoft/microsoft.go b/microsoft/microsoft.go index f21b398..2fe8afc 100644 --- a/microsoft/microsoft.go +++ b/microsoft/microsoft.go @@ -14,3 +14,14 @@ var LiveConnectEndpoint = oauth2.Endpoint{ AuthURL: "https://login.live.com/oauth20_authorize.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", + } +}