asp.net web api - How to authenticate user
To make a user authenticated you have to perform a sign in operation.
What you do in your Login
method is checking the credentials, but sign in is where you (with help of some authentication API) set user identity into (most commonly) a cookie, like:
FormsAuthentication.SetAuthCookie(model.Email, model.RememberMe);
Authorization and Authentication ASP.Net web api
A quick solution is to extend AuthorizeAttribute
and define your authentication logic there. See this SO question for an example.
A little bit more modular approach is to create an authentication filter. See ASP.NET docs here. This way you can separate authentication and authorization.
As for HMAC vs Basic authentication, I would go with the simpler Basic authentication is security is not a key component of your system. This way you can ship v1.0 faster.
The authorization is not working in ASP.net core web API
I found the solution.... I was declaring a key in the generation of the token which is different from the one I've declared in the appsetting.json
so when the TokenValidationParameters takes the wrong key it was preventing authorization
Related Topics
How to Get Data from Service to Activity
Does Android Support Jdk 6 or 7
How to Get the Google Username on Android
How to Remove All Listeners Added with Addtextchangedlistener
Android Cannot Pass Intent Extras Though Alarmmanager
Android:Passing a Hash Map Between Activities
Android - Supportmapfragment with Googlemaps API 2.0 Giving Illegalargumentexception
Android: How to Make an Activity Return Results to the Activity Which Calls It
Android Studio Stuck on "Gradle: Resolve Dependencies '_Debugcompile'" or 'Detachedconfiguration1'
How to Use Android Progressbar in Determinate Mode
Transparent Alertdialog Has Black Background
Android: Open Activity Without Save into the Stack
How to Create Android Spinner Without Down Triangle on the Right Side of the Widget
How to Determine If an Android Service Is Running in the Foreground
Popupwindow $Badtokenexception: Unable to Add Window -- Token Null Is Not Valid
Firebase Cloud Messaging Notification Not Received by Device