示例#1
0
 public Task SignInAsync(IPermission permission)
 {
     if (permission == null)
     {
         throw new ArgumentNullException(nameof(permission));
     }
     _CurrentPrincipal = new MockPrincipal(permission, _SecurityProvider);
     return(Task.CompletedTask);
 }
示例#2
0
        public async Task <bool> SignInAsync(IDictionary <string, string> properties)
        {
            var permission = await _SecurityProvider.GetPermissionAsync(properties);

            if (permission == null)
            {
                return(false);
            }
            _CurrentPrincipal = new MockPrincipal(permission, _SecurityProvider);
            return(true);
        }
示例#3
0
 public Task SignOutAsync()
 {
     _CurrentPrincipal = new MockPrincipal(_SecurityProvider);
     return(Task.CompletedTask);
 }
示例#4
0
 public MockAuthenticationProvider(ISecurityProvider securityProvider)
 {
     _SecurityProvider = securityProvider;
     _CurrentPrincipal = new MockPrincipal(securityProvider);
 }