Пример #1
0
 /// <summary>
 ///     Extracts login info out of an external identity
 /// </summary>
 /// <param name="manager"></param>
 /// <returns></returns>
 public static InspurExternalLoginInfo InspurGetExternalLoginInfo(this IAuthenticationManager manager)
 {
     if (manager == null)
     {
         throw new ArgumentNullException("manager");
     }
     return(InspurAsyncHelper.RunSync(manager.InspurGetExternalLoginInfoAsync));
 }
Пример #2
0
 /// <summary>
 /// Return the identity associated with the default external authentication type
 /// </summary>
 /// <param name="manager"></param>
 /// <param name="externalAuthenticationType"></param>
 /// <returns></returns>
 public static ClaimsIdentity InspurGetExternalIdentity(this IAuthenticationManager manager,
                                                        string externalAuthenticationType)
 {
     if (manager == null)
     {
         throw new ArgumentNullException("manager");
     }
     return(InspurAsyncHelper.RunSync(() => manager.GetExternalIdentityAsync(externalAuthenticationType)));
 }
Пример #3
0
 /// <summary>
 ///     Returns true if there is a TwoFactorRememberBrowser cookie for a user
 /// </summary>
 /// <param name="manager"></param>
 /// <param name="userId"></param>
 /// <returns></returns>
 public static bool InspurTwoFactorBrowserRemembered(this IAuthenticationManager manager,
                                                     string userId)
 {
     if (manager == null)
     {
         throw new ArgumentNullException("manager");
     }
     return(InspurAsyncHelper.RunSync(() => manager.TwoFactorBrowserRememberedAsync(userId)));
 }
Пример #4
0
 /// <summary>
 ///     Extracts login info out of an external identity
 /// </summary>
 /// <param name="manager"></param>
 /// <param name="xsrfKey">key that will be used to find the userId to verify</param>
 /// <param name="expectedValue">
 ///     the value expected to be found using the xsrfKey in the AuthenticationResult.Properties
 ///     dictionary
 /// </param>
 /// <returns></returns>
 public static InspurExternalLoginInfo InspurGetExternalLoginInfo(this IAuthenticationManager manager, string xsrfKey,
                                                                  string expectedValue)
 {
     if (manager == null)
     {
         throw new ArgumentNullException("manager");
     }
     return(InspurAsyncHelper.RunSync(() => manager.InspurGetExternalLoginInfoAsync(xsrfKey, expectedValue)));
 }