示例#1
0
 public IActionResult Token([FromBody] BasicAuthClaims user)
 {
     try
     {
         TokenResponse tokenResponse = accountIdentityProvider.GetIdentity(user);
         return(Ok(tokenResponse));
     }
     catch (ArgumentException ex)
     {
         return(BadRequest(ex.Message));
     }
 }
示例#2
0
        public async Task <IActionResult> Token([FromBody] BasicAuthClaims user)
        {
            try
            {
                // get token
                TokenResponse tokenResponse = await accountIdentityProvider.GetIdentity(user)
                                              .ConfigureAwait(false);

                return(Ok(tokenResponse));
            }
            catch (ArgumentNullException ex)
            {
                return(BadRequest(ex.Message));
            }
        }