Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 /// <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);
 }
Exemplo n.º 3
0
 private static void PlatformSignOut()
 {
     MSAuth.SignOut();
 }
Exemplo n.º 4
0
 static Task PlatformSetEnabledAsync(bool enabled)
 {
     MSAuth.SetEnabled(enabled);
     return(Task.CompletedTask);
 }
Exemplo n.º 5
0
 static Task <bool> PlatformIsEnabledAsync()
 {
     return(Task.FromResult(MSAuth.IsEnabled()));
 }
Exemplo n.º 6
0
 private static void PlatformSetConfigUrl(string configUrl)
 {
     MSAuth.SetConfigUrl(configUrl);
 }