public Response <ClientTokenDTOs> CreateTokenByClient(ClientLoginDTOs clientLoginDTOs)
        {
            var client = _clients.SingleOrDefault(c => c.Id == clientLoginDTOs.Id && c.Secret == clientLoginDTOs.Secret);

            if (client == null)
            {
                return(Response <ClientTokenDTOs> .Fail("ClientId or ClientSecret not found", 404, true));
            }
            var token = _tokenService.CreateTokenByClient(client);

            return(Response <ClientTokenDTOs> .Success(token, 200));
        }
Beispiel #2
0
        public IActionResult CreateTokenByClient(ClientLoginDTOs clientLoginDTOs)
        {
            var result = _authenticationService.CreateTokenByClient(clientLoginDTOs);

            return(ActionResultInstance(result));
        }