예제 #1
0
 public static PluginAuthInfo Create(AuthInfo authInfo, string realmName)
 {
     return(new PluginAuthInfo(authInfo.Principal(), realmName, new HashSet <>(authInfo.Roles())));
 }
예제 #2
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())));
     }
 }
예제 #3
0
 private PluginAuthInfo(AuthInfo authInfo, SimpleHash hashedCredentials, string realmName) : this(authInfo.Principal(), hashedCredentials.Bytes, hashedCredentials.Salt, realmName, new HashSet <string>(authInfo.Roles()))
 {
 }