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)); } }
private static PluginAuthenticationInfo Create(AuthenticationInfo authenticationInfo, SimpleHash hashedCredentials, string realmName) { return(new PluginAuthenticationInfo(authenticationInfo.Principal(), hashedCredentials.Bytes, hashedCredentials.Salt, realmName)); }
private static PluginAuthenticationInfo Create(AuthenticationInfo authenticationInfo, string realmName) { return(new PluginAuthenticationInfo(authenticationInfo.Principal(), realmName, null)); }