get username

lawrence whittemore asked on September 29, 2021 20:35

how would I go about getting the current users username in the .net core application?

Correct Answer

Dmitry Bastron answered on September 30, 2021 06:52

Hi Lawrence,

It is mentioned in the documentation though, please refer to this article, on the bottom of the page there is a tip:

Tip: When writing additional code or views for your website, you can access information about the currently authenticated user via the User property. For example, User.Identity.Name returns the username of the currently signed-in user.
0 votesVote for this answer Unmark Correct answer

Recent Answers


lawrence whittemore answered on September 29, 2021 21:33

I found this, I beleive it is what I'll need string activeUserName = UserInfoProvider.GetUserName();

What I am struggling with, where in the documentation would I find this? If not in the documentation, how would someone go about figuring this out without having to google everything?

0 votesVote for this answer Mark as a Correct answer

Zach Perry answered on September 29, 2021 22:33

You can look at the API reference, it might help:

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.