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