public void Init() { // set this so we can fiddle ServicePointManager.ServerCertificateValidationCallback += delegate { return true; }; var auth = new DirectoryGraphAuthentication(ConfigurationManager.AppSettings["TenantId"], ConfigurationManager.AppSettings["SymmetricKey"], ConfigurationManager.AppSettings["AppPrincipalId"]); var accessToken = auth.GetAccessToken(); // you can cache this until token.ExpiresOn this.graph = new DirectoryGraph(ConfigurationManager.AppSettings["TenantId"], accessToken.AccessToken); }
public void Init() { // set this so we can fiddle ServicePointManager.ServerCertificateValidationCallback += delegate { return(true); }; var auth = new DirectoryGraphAuthentication(ConfigurationManager.AppSettings["TenantId"], ConfigurationManager.AppSettings["SymmetricKey"], ConfigurationManager.AppSettings["AppPrincipalId"]); var accessToken = auth.GetAccessToken(); // you can cache this until token.ExpiresOn this.graph = new DirectoryGraph(ConfigurationManager.AppSettings["TenantId"], accessToken.AccessToken); }