TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Karan Thakkar
1.5k
204
89.5k
How to get custom claims in asp.net core?
Aug 14 2019 5:13 AM
var claims = new List<Claim>
{
new Claim(ClaimTypes.Name, user.UserNm),
new Claim(ClaimTypes.Role, user.UserRole),
new Claim(ClaimTypes.NameIdentifier, user.LoginId),
new Claim("Email", user.EmailId)
};
--I have created above claims, in that I have a custom claim which is Email Id I want to fetch that data inside my user object how can I achieve it and also Role.
User user = new User();
System.Security.Claims.ClaimsPrincipal currentUser = this.User;
user.UserNm = User.Identity.Name;
user.UserRole=?
Big thanks in advance if anyone can help me.
Reply
Answers (
2
)
How to show all Lined-up in DataTable?
pass command line arguments from asp.net web application c#