Beispiel #1
0
 public static PluginAuthInfo CreateCacheable(AuthInfo authInfo, string realmName, SecureHasher secureHasher)
 {
     if (authInfo is CacheableAuthInfo)
     {
         sbyte[]    credentials       = (( CacheableAuthInfo )authInfo).credentials();
         SimpleHash hashedCredentials = secureHasher.Hash(credentials);
         return(new PluginAuthInfo(authInfo, hashedCredentials, realmName));
     }
     else
     {
         return(new PluginAuthInfo(authInfo.Principal(), realmName, new HashSet <>(authInfo.Roles())));
     }
 }
Beispiel #2
0
 public static PluginAuthInfo Create(AuthInfo authInfo, string realmName)
 {
     return(new PluginAuthInfo(authInfo.Principal(), realmName, new HashSet <>(authInfo.Roles())));
 }
Beispiel #3
0
 private PluginAuthInfo(AuthInfo authInfo, SimpleHash hashedCredentials, string realmName) : this(authInfo.Principal(), hashedCredentials.Bytes, hashedCredentials.Salt, realmName, new HashSet <string>(authInfo.Roles()))
 {
 }