示例#1
0
        public IActionResult ConfirmOperation([FromBody] OperationConfirmationModel model)
        {
            var command = new ConfirmCommand
            {
                OperationId  = model.OperationId,
                ClientId     = Guid.Parse(_requestContext.ClientId),
                Confirmation = model.Signature.Code
            };

            _cqrsEngine.SendCommand(command, "apiv2", OperationsBoundedContext.Name);

            return(Ok());
        }
        public void Post2FAOperations()
        {
            Step("Make POST /api/2fa/operation and validate response", () =>
            {
                var model = new OperationConfirmationModel
                {
                    OperationId = Guid.NewGuid().ToString(),
                    Signature   = new OperationConfirmationSignature {
                        Code = "1111"
                    },
                    Type = ""
                };

                var response = apiV2.SecondFactorAuth.Post2FAOperation(model, token);

                Assert.That(response.StatusCode, Is.EqualTo(HttpStatusCode.OK));
            });
        }
 public IResponse Post2FAOperation(OperationConfirmationModel model, string token)
 {
     return(Request.Post("/2fa/operation").AddJsonBody(model).WithBearerToken(token).Build().Execute());
 }