Exemple #1
0
        /// <summary>
        /// Login and create the connection, if necessary.
        /// </summary>
        public static async Task Login()
        {
            if (Connection == null || !LiveIdAuth.IsSignedIn)
            {
                // Get an OAuth2 access token through REST.
                var token = await LiveIdAuth.GetAuthToken();

                // Initialize connection
                Connection = new ODConnection("https://api.onedrive.com/v1.0", new OneDriveSdkAuthenticationInfo(token));
            }
        }
Exemple #2
0
 /// <summary>
 ///     Gets a valid authentication token for the selected Authentication provider
 /// </summary>
 /// <remarks>
 ///     Used by the API request generators before making calls to the OneNote APIs.
 /// </remarks>
 /// <returns>valid authentication token</returns>
 internal static async Task <string> GetAuthToken(AuthProvider provider)
 {
     return(await LiveIdAuth.GetAuthToken());
 }