Example #1
0
 public User(long id, string nameId, AuthenticationSchema authenticationSchema, string name, UserRole role, bool active)
 {
     Id     = id;
     NameId = nameId;
     Name   = name;
     Role   = role;
     Active = active;
 }
Example #2
0
 public User(string nameId, AuthenticationSchema authenticationSchema, string name, UserRole role, bool active)
 {
     NameId = nameId;
     AuthenticationSchema = authenticationSchema;
     Name   = name;
     Role   = role;
     Active = active;
 }
Example #3
0
        public void AddAuthorization(AuthenticationSchema schema, string hash)
        {
            if (string.IsNullOrWhiteSpace(hash))
            {
                throw new ArgumentNullException(nameof(hash));
            }

            switch (schema)
            {
            case AuthenticationSchema.Basic:
                AuthorizationHeader = $"Basic {hash}";
                break;

            case AuthenticationSchema.Bearer:
                AuthorizationHeader = $"Bearer {hash}";
                break;
            }
        }