From 00acb66e39f7b178d58f3f0ec298aec73d7aced9 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Tue, 15 Nov 2022 21:52:57 -0600 Subject: AƱadida autenticaciĆ³n MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controllers/MessageController.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Controllers/MessageController.cs (limited to 'Controllers/MessageController.cs') diff --git a/Controllers/MessageController.cs b/Controllers/MessageController.cs new file mode 100644 index 0000000..bacaf5c --- /dev/null +++ b/Controllers/MessageController.cs @@ -0,0 +1,17 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Authorization; + +namespace IdentityAPI.Controllers { + [ApiController] + [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] + [Route("api/message")] + public class MessageController : ControllerBase { + public MessageController() {} + + [HttpGet] + public async Task Show() { + return Ok(new { message = "Authentication succesful" }); + } + } +} \ No newline at end of file -- cgit v1.2.3