예제 #1
0
        [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());
        }
예제 #2
0
 public TokenController(GetToken getToken, DescribeToken describeToken)
 {
     GetToken      = getToken;
     DescribeToken = describeToken;
 }