Exemple #1
0
 public static PluginAuthenticationInfo CreateCacheable(AuthenticationInfo authenticationInfo, string realmName, SecureHasher secureHasher)
 {
     if (authenticationInfo is CustomCacheableAuthenticationInfo)
     {
         CustomCacheableAuthenticationInfo info = ( CustomCacheableAuthenticationInfo )authenticationInfo;
         return(new PluginAuthenticationInfo(authenticationInfo.Principal(), realmName, info.CredentialsMatcher()));
     }
     else if (authenticationInfo is CacheableAuthenticationInfo)
     {
         sbyte[]    credentials       = (( CacheableAuthenticationInfo )authenticationInfo).credentials();
         SimpleHash hashedCredentials = secureHasher.Hash(credentials);
         return(PluginAuthenticationInfo.Create(authenticationInfo, hashedCredentials, realmName));
     }
     else
     {
         return(PluginAuthenticationInfo.Create(authenticationInfo, realmName));
     }
 }
Exemple #2
0
 private static PluginAuthenticationInfo Create(AuthenticationInfo authenticationInfo, SimpleHash hashedCredentials, string realmName)
 {
     return(new PluginAuthenticationInfo(authenticationInfo.Principal(), hashedCredentials.Bytes, hashedCredentials.Salt, realmName));
 }
Exemple #3
0
 private static PluginAuthenticationInfo Create(AuthenticationInfo authenticationInfo, string realmName)
 {
     return(new PluginAuthenticationInfo(authenticationInfo.Principal(), realmName, null));
 }