📅  最后修改于: 2022-03-11 14:56:20.498000             🧑  作者: Mango
var credential = new ClientCredential(ClientId, ClientSecret);
// Authenticate using created credentials
string AuthorityUrl = "https://login.microsoftonline.com/"+ADdomain+"/oauth2/v2.0/authorize";
var authenticationContext = new AuthenticationContext(AuthorityUrl);
var authenticationResult = await authenticationContext.AcquireTokenAsync(ResourceUrl, credential);