Пример #1
0
        public IdentityPrincipal(PrincipalId principalId, IdentityPrincipalType principalType)
        {
            Verify.IsNotEmpty(nameof(principalId), principalId);

            PrincipalId   = principalId;
            PrincipalType = principalType;
            _properties   = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
        }
Пример #2
0
        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);
        }