I have an ASP.NET MVC 5 project and I authenticate users via an external service that using OAuth2.0. After user is authenticated, the service returns users' id, name and surname without any problem.
At this stage, I also need to authorize users after they login by using JWT and I use id of them to pass JWT. In addition to that I also need to prevent unathenticated users from accessing Index page by using [Authorize], etc. decorator on the action methods as in MVC and set their session expiration e.g. 2 minutes. I look at many pages and articles on the web but almost all examples or samples are for .NET Core and not suitable for .NET MVC :( There are just some examples i.e. How to use JWT in MVC application for authentication and authorization? but not detailed and missing explanations on Startup and Controller classes. As I have no experience about JWT, I need a good example covering Startup, Controller methods e.g. Login, Authenticate, etc. Is there any or could you post by completing the missing part of the example on How to use JWT in MVC application for authentication and authorization?? Any help would be appreciated.