Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Azure provider - Add Support for US Gov L4 #211

Merged
merged 4 commits into from
Jul 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion provider_azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ import (

const (
// Deprecated: The host of the Azure Active Directory (AAD) graph API
azureADGraphHost = "graph.windows.net"
azureADGraphHost = "graph.windows.net"
azureADGraphUShost = "graph.microsoftazure.us"

// The host and version of the Microsoft Graph API
microsoftGraphHost = "graph.microsoft.com"
microsoftGraphUSHost = "graph.microsoft.us"
microsoftGraphAPIVersion = "/v1.0"

// Distributed claim fields
Expand Down Expand Up @@ -114,9 +116,13 @@ func (a *AzureProvider) getClaimSource(logger log.Logger, allClaims map[string]i
// and will eventually stop servicing requests. See details at:
// - https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-or-azure-ad-graph/
// - https://docs.microsoft.com/en-us/graph/api/overview?view=graph-rest-1.0
// - https://docs.microsoft.com/en-us/graph/migrate-azure-ad-graph-request-differences
if urlParsed.Host == azureADGraphHost {
MarkDordoy marked this conversation as resolved.
Show resolved Hide resolved
urlParsed.Host = microsoftGraphHost
urlParsed.Path = microsoftGraphAPIVersion + urlParsed.Path
} else if urlParsed.Host == azureADGraphUShost {
urlParsed.Host = microsoftGraphUSHost
urlParsed.Path = microsoftGraphAPIVersion + urlParsed.Path
}

logger.Debug(fmt.Sprintf("found Azure Graph API endpoint for group membership: %v", urlParsed.String()))
Expand Down