Пример #1
0
 public Task <AuthenticationResult> AuthenticateAsync(string clientId, string username, string password, EndPoint clientAddress)
 {
     if (!clientId.Equals(username, StringComparison.Ordinal))
     {
         return(Task.FromResult(AuthenticationResult.Failure()));
     }
     return(Task.FromResult(AuthenticationResult.SuccessWithDeviceKey(clientId, password)));
 }
        public Task <AuthenticationResult> AuthenticateAsync(string clientId, string username, string password, EndPoint clientAddress)
        {
            Identity identity = Identity.Parse(username);

            if (!clientId.Equals(identity.DeviceId, StringComparison.Ordinal))
            {
                return(Task.FromResult((AuthenticationResult)null));
            }
            return(Task.FromResult(AuthenticationResult.SuccessWithDeviceKey(identity, password)));
        }