summaryrefslogtreecommitdiff
path: root/Controllers/MessageController.cs
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2022-11-15 21:52:57 -0600
committerHombreLaser <sebastian-440@live.com>2022-11-15 21:52:57 -0600
commit00acb66e39f7b178d58f3f0ec298aec73d7aced9 (patch)
treeb2340ca37d815a4da9870c3ecd483e8dbcf95a44 /Controllers/MessageController.cs
parent820c3a882c60127338293c1eee4059b2dfd535df (diff)
Añadida autenticación
Diffstat (limited to 'Controllers/MessageController.cs')
-rw-r--r--Controllers/MessageController.cs17
1 files changed, 17 insertions, 0 deletions
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<IActionResult> Show() {
+ return Ok(new { message = "Authentication succesful" });
+ }
+ }
+} \ No newline at end of file