private async Task <ClaimsIdentity> GetIdentityAsync(string username, string password, string grantType)
        {
            var context = new AccountContext(Configuration.GetConnectionString("DefaultConnection"));

            var account = await context.GetAccountAsync(username);

            if (account != null && grantType == "password" && account.Password == password)
            {
                return(await Task.FromResult(new ClaimsIdentity(new GenericIdentity(username, "Token"), new Claim[] { })));
            }

            // Account doesn't exists
            return(await Task.FromResult <ClaimsIdentity>(null));
        }