@@ -25,10 +25,17 @@ func (g *GraphAPIHandler) ConstructAPIResourceEndpoint(instanceName string, endp
2525 return url
2626}
2727
28- // ConstructAPIAuthEndpoint constructs the full URL for a graph API auth endpoint path and logs the URL.
29- func (g * GraphAPIHandler ) ConstructAPIAuthEndpoint (instanceName string , endpointPath string , log logger.Logger ) string {
30- urlBaseDomain := g .SetBaseDomain ()
31- url := fmt .Sprintf ("https://%s%s%s" , instanceName , urlBaseDomain , endpointPath )
32- g .Logger .Debug (fmt .Sprintf ("Constructed %s API authentication URL" , APIName ), zap .String ("URL" , url ))
28+ // ConstructAPIAuthEndpoint constructs the full URL for the Microsoft Graph API authentication endpoint.
29+ // It uses the provided tenant name and endpoint path and logs the constructed URL.
30+ func (g * GraphAPIHandler ) ConstructAPIAuthEndpoint (tenantName string , endpointPath string , log logger.Logger ) string {
31+ // The base URL for the Microsoft Graph API authentication endpoint.
32+ const baseURL = "https://login.microsoftonline.com"
33+
34+ // Construct the full URL by combining the base URL, tenant name, and endpoint path.
35+ url := fmt .Sprintf ("%s/%s%s" , baseURL , tenantName , endpointPath )
36+
37+ // Log the constructed URL for debugging purposes.
38+ log .Debug (fmt .Sprintf ("Constructed Microsoft Graph API authentication URL" ), zap .String ("URL" , url ))
39+
3340 return url
3441}
0 commit comments