using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace HanyadikHetVan.Controllers { [Route("api/test")] [ApiController] public class TestController : ControllerBase { [HttpGet("unprotected")] public string Unprotected() { return "Unprotected"; } [Authorize] [HttpGet("protected")] public string Protected() { return "Protected"; } } }