A
A
Anton Belousov2018-12-11 10:38:45
ASP.NET
Anton Belousov, 2018-12-11 10:38:45

ASP.NET Core how to display current users?

Hello, I ran into a problem when writing an application on ASP.Net Core 1.1.
There is a task to deduce the current, authorized users.
I surfed the internet and found several ways.
1) The handler of all requests at the Middleware level.
2) Handler of all requests by sessions.
However, I would like to do all this with built-in tools.
Please help, if there is not enough information, I will add everything that is needed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
basrach, 2018-12-11
@EnemySik

1) The handler of all requests at the Middleware level.
2) Handler of all requests by sessions.

Otherwise, it is impossible. Whether a user is authorized or not is checked by checking his cookie. The server does not store cookies for all authorized users and, accordingly, the server does not have the information you need. If you need such data, then you need to independently implement the collection and storage of user authorization results. And with the help of what it can be done, you have already been told.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question