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
 internal static async Task <string> GetUserName(AuthProvider provider)
 {
     return(await LiveIdAuth.GetUserName());
 }
Exemple #3
0
 internal static async Task SignOut(AuthProvider provider)
 {
     await LiveIdAuth.SignOut();
 }
Exemple #4
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());
 }
Exemple #5
0
 public async Task <bool> RefreshAccessTokenAsync()
 {
     return(await LiveIdAuth.RefreshAuthTokenIfNeeded());
 }