public override Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context)
        {
            Try.Condition(!string.IsNullOrEmpty(context.UserName) && !string.IsNullOrEmpty(context.Password), "The user name or password is incorrect;");

            var user = context.GetWispContext().Data.Accounts.FirstOrDefault(x => x.Login == context.UserName && x.Active);

            Try.Condition(user != null && user.ComparePasword(context.Password), "The user name or password is incorrect;");

            context.Validated(GetBearerIdentity(user));

            return(Task.FromResult(0));
        }