public IdentityPrincipal With(ApiKey apiKey) { Verify.IsNotEmpty(nameof(apiKey), apiKey); return(new IdentityPrincipal(PrincipalId, PrincipalType, apiKey, _properties)); }
public IdentityPrincipal(PrincipalId clientId, IdentityPrincipalType principalType, ApiKey apiKey, IEnumerable <KeyValuePair <string, string> > properties) { Verify.IsNotEmpty(nameof(clientId), clientId); PrincipalId = clientId; PrincipalType = principalType; ApiKey = apiKey; properties = properties ?? Enumerable.Empty <KeyValuePair <string, string> >(); _properties = properties.ToDictionary(x => x.Key, x => x.Value, StringComparer.OrdinalIgnoreCase); }