How to use middle war to get next request asp.net core 2 ?

Posted by Ahmedsa under ASP.NET Core on 9/15/2019 | Points: 10 | Views : 5353 | Status : [Member] | Replies : 3
How to get next request pipeline in case of token success .

suppose i need to get data from action result get request by post man

Code:
[HttpGet(Contracts.ApiRoutes.Security.GetUserMenus)]  
public IActionResult GetUserMenu(string userId)
{
string strUserMenus = _SecurityService.GetUserMenus(userId);
return Ok(strUserMenus);
}

i write on postman link as then select get then write on header

key : authorization
value :eeerrttyyyyy

when invalid access token then it will show message invalid token

if valid access token it will continue execution and get result from action

this is actually i need on next but cannot do it .

Code:
public async Task InvokeAsync(HttpContext context, DataContext dataContext)  
{

var validKey = false;


if (!validKey)
{
context.Response.StatusCode = (int)HttpStatusCode.Forbidden;
await context.Response.WriteAsync("Invalid Token");
}
//if validm than next middleware Invoke
else
{
//success token
context.Request.EnableRewind();
await _next.Invoke(context);
// how to get next request meaning i need to get result of action getusermenu

}


}
}

http://www.mediafire.com/view/h5am34...token.png/file




Responses

Posted by: Jason1022 on: 10/7/2019 [Member] Starter | Points: 25

Up
0
Down
Even though I use nvim almost exclusively with keyboard, mouse browsing can be very helpful for casually switching tabs and scrolling through some code when just checking things out. The set mouse=a is actually really well set out and configured out of the box to make it feel home to people coming from other editors. With set mouse=a you can essentially use vim like any other editor which can be welcoming to beginners and is generally quite nice for browsing through code casually.https://openweb.vip/whatsapp-web/ https://19216801.onl/ https://routerlogin.uno/

Ahmedsa, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jacoboram550 on: 10/28/2019 [Member] Starter | Points: 25

Up
0
Down
This is one of the best website for getting knowledge and sharing comments. <a href="https://www.theacademicpapers.co.uk/dissertation-writing-services-uk.php">dissertation writing services</a>

Ahmedsa, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kanerobert on: 11/19/2019 [Member] Starter | Points: 25

Up
0
Down
I really enjoyed reading your article. I found this as an informative and interesting post, so i think it is very useful and knowledgeable. I would like to thank you for the effort you have made in writing this article.
https://friv2020.io/

Ahmedsa, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response