I'm trying to get user with the graph service client:
import (
"bytes"
"encoding/json"
"fmt"
azure "github.com/microsoft/kiota/authentication/go/azure"
msgraphsdkgo "github.com/microsoftgraph/msgraph-sdk-go"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
)
cred, _ := azidentity.NewClientSecretCredential(
"<my-tenant-id>",
"<my-client-id>",
"<my-client-secret>",
&azidentity.ClientSecretCredentialOptions{
AuthorityHost: azidentity.AzureChina,
})
auth, _ := azure.NewAzureIdentityAuthenticationProviderWithScopes(cred, []string{
"https://microsoftgraph.chinacloudapi.cn/.default",
})
adapter, _ := msgraphsdkgo.NewGraphRequestAdapter(auth)
client := msgraphsdkgo.NewGraphServiceClient(adapter)
users, _ := client.Users().Get(nil)
fmt.Println(users)
it got nil:
but the config worked when I user Postman:

So I read code and see in msgraphsdkgo.NewGraphServiceClient:

it's https://microsoftgraph.chinacloudapi.cn/v1.0 for Azure AD of China, and it seems that I can't change this value:

Thanks for your attention.
I'm trying to get user with the graph service client:
it got nil:
but the config worked when I user Postman:

So I read code and see in


msgraphsdkgo.NewGraphServiceClient:it's https://microsoftgraph.chinacloudapi.cn/v1.0 for Azure AD of China, and it seems that I can't change this value:
Thanks for your attention.