Open arcange opened 4 years ago
Use of typed interface with declarative annotations for mapping with claims keys sounds neat and readable :
class User {
[Claim(ClaimTypes.Sid)]
public string Id { get: set; }
[Claim(ClaimTypes.Name)]
public string Name { get: set; }
}
While executing http requests, we often need to get some information about current user (authenticated api calls).
I suggest we store user data in claims at authentication time in order to access them from memory. Claims are standards, and many claims keys are already defined in base library (firstname, lastname, email, ...). Maybe there even are TOO many standard keys, so we should find a way to reduce the possibilities to application needs (through some UserHelper or any typed interface)