This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Startup(IConfiguration configuration) | |
{ | |
_configuration = configuration; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) | |
.AddJwtBearer(options => | |
{ | |
options.TokenValidationParameters = new TokenValidationParameters | |
{ | |
ValidateLifetime = true, | |
ValidateIssuerSigningKey = true, | |
IssuerSigningKey = new SymmetricSecurityKey( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Authorize] | |
[Route("api")] | |
public class ApiController : Controller | |
{ | |
[HttpGet("Test")] | |
public IActionResult Test() | |
{ | |
return Ok("Content secured with Approov Token"); | |
} |