@@ -25,10 +25,17 @@ func (g *GraphAPIHandler) ConstructAPIResourceEndpoint(instanceName string, endp
25
25
return url
26
26
}
27
27
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
+
33
40
return url
34
41
}
0 commit comments