public static AuthorityOptions AddMemoryAuthStore(this AuthorityOptions authority, Action <MemoryAuthStoreOptions> config = null)
        {
            if (authority == null)
            {
                throw new ArgumentNullException(nameof(authority));
            }

            var options = new MemoryAuthStoreOptions();

            config?.Invoke(options);
            return(AddMemoryAuthStore(authority, options));
        }
        public static AuthorityOptions AddMemoryAuthStore(this AuthorityOptions authority, MemoryAuthStoreOptions options)
        {
            if (authority == null)
            {
                throw new ArgumentNullException(nameof(authority));
            }

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            authority.Services.AddSingleton(options);
            authority.Services.AddSingleton <IAuthStore, MemoryAuthStore>();
            return(authority);
        }
Exemplo n.º 3
0
 public static MemoryAuthStoreOptions Add(this MemoryAuthStoreOptions options, IAuthTarget target, IEnumerable <IAuthActivity> activities)
 {
     options.Items.Add(new AuthItem(target, activities));
     return(options);
 }
Exemplo n.º 4
0
 public MemoryAuthStore(MemoryAuthStoreOptions options)
 {
     this.Options = options;
 }
Exemplo n.º 5
0
 public static MemoryAuthStoreOptions Add(this MemoryAuthStoreOptions options, IAuthTarget target, params IAuthActivity[] activities)
 {
     options.Items.Add(new AuthItem(target, activities));
     return(options);
 }