[HttpPost] public IActionResult Create(string username, string password, string grant_type) { var taskAuthen = GetToken.Execute(username, password); if (taskAuthen.IsCompletedSuccessfully) { var token = taskAuthen.Result; if (!string.IsNullOrEmpty(token)) { return(Ok(token)); } } return(Unauthorized()); }
public TokenController(GetToken getToken, DescribeToken describeToken) { GetToken = getToken; DescribeToken = describeToken; }