private static Task <UserInformation> PlatformSignInAsync() { var taskCompletionSource = new TaskCompletionSource <UserInformation>(); MSAuth.SignIn((userInformation, error) => { if (error != null) { taskCompletionSource.TrySetException(new NSErrorException(error)); } else { taskCompletionSource.TrySetResult(new UserInformation(userInformation.AccountId, userInformation.AccessToken, userInformation.IdToken)); } }); return(taskCompletionSource.Task); }
/// <summary> /// Process URL request for the Auth service. /// Place this method call into app delegate openUrl method. /// </summary> /// <param name="url">The url with parameters.</param> /// <param name="options">A dictionary of URL handling options.</param> public static void OpenUrl(NSUrl url, NSDictionary options) { MSAuth.OpenUrl(url, options); }
private static void PlatformSignOut() { MSAuth.SignOut(); }
static Task PlatformSetEnabledAsync(bool enabled) { MSAuth.SetEnabled(enabled); return(Task.CompletedTask); }
static Task <bool> PlatformIsEnabledAsync() { return(Task.FromResult(MSAuth.IsEnabled())); }
private static void PlatformSetConfigUrl(string configUrl) { MSAuth.SetConfigUrl(configUrl); }