Part 1 : Token based authentication using ASP.NET Web API 2

sourav mondal · 292K views · 2016 · 45:43

Open on YouTube

Web developmentSecurity & hackingtutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when someone is struggling with Web API authorization errors or wants a hands-on starting point for issuing and using bearer tokens.

Recommended by 3 people across 3 different months, 2016 to 2021.

What it is

A 45-minute tutorial walkthrough of securing an ASP.NET Web API 2 service with token-based authentication using Microsoft.Owin. It is presented by Sourav Mondal and accompanies a written article on dotnetawesome.com.

What people said

Recommends SamyCode · 2016-12 · Stack Overflow · on “Getting "Authorization has been denied for this request" from Postman when trying to consume simple .NET web api”

@Michael I sent a cookie named ".AspNet.Cookies" with the token with not avail. I also tried "Authorization" and "Bearer" names. Thank you for the documentation though. I am thinking to just switch to token based authorization. This is also a nice video to do so: [this video]

Recommends User3250 · 2017-05 · Stack Overflow · on “Is it possible to restrict access to REST API built using Web API 2?”

Did you happen to check token based authentication?Please go through [LINK] and [this video] must be a good to start with.

Recommends user14979715 · 2021-08 · Stack Overflow · on “How to consume my authorized web api to my mvc web app”

I have a web api controller which retrieves data from my database and a mvc web app controller which consumes this web api. In my web api I used Microsoft.Owin for security and generating a token. Later, I am using this token taken from my web api via postman, and placing it statically on my web app. What I want to do is dynamically store every token I generate from every request and not copy-pasting it every time. I used this [this video] video for creating my web api and generatin jwt token, and this [LINK] video to consume my web api. Please help me, I'm stuck here for days now. EDIT: My web api controller: [Authorize] [HttpGet] public IHttpActionResult GetOperators() { IList<OperatorClass> Op