/// <summary> /// Initializes this instance. /// </summary> public static void Init(string tenantId, string clientId) { // Reply Url. If created from app reg portal, this is by default one of thh reply Urls. else it needs to be defined manually string replyUrl = string.Format(Constants.AuthorityUriFormat, tenantId); IdentityClientApp = new PublicClientApplication( clientId, replyUrl, TokenCacheHelper.GetUserCache()); }
/// <summary> /// Constructor. /// </summary> /// <param name="applicationId">The application ID.</param> public GraphApiClient(string applicationId) { if (string.IsNullOrEmpty(applicationId)) { throw new ArgumentNullException("Application ID cannot be empty"); } PublicClientApplication = new PublicClientApplication(applicationId, MicrosoftLoginEndpoint, TokenCacheHelper.GetUserCache()); }
static ApplicationGlobal() { _clientApp = new PublicClientApplication(ClientId, "https://login.microsoftonline.com/common", TokenCacheHelper.GetUserCache()); }