I've a get token method (endpoint) like below. It's decorated with an [AllowAnonymous]
annotation - anyone can access this method.
[AllowAnonymous]
[HttpPost("get_token")]
public ActionResult<TokenResponseModel> Authenticate([FromBody] AuthenticateModel authenticateModel, [FromHeader] string jwtToken)
{
// some code
}
Now once the token is generated, I have step 2 in the authentication process: for that I'm calling the same endpoint with an additional value which is selected from user to generate new token and I'll add the already generated token in header. So I need to create this method as AllowAnonymous
also & I need to validate token if I've added token in header like below.
Note: our client doesn't want to create new endpoint for this case.
Please let me know if you have any idea. Thanks