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);
        }
예제 #3
0
 public static MemoryAuthStoreOptions Add(this MemoryAuthStoreOptions options, IAuthTarget target, IEnumerable <IAuthActivity> activities)
 {
     options.Items.Add(new AuthItem(target, activities));
     return(options);
 }
예제 #4
0
 public MemoryAuthStore(MemoryAuthStoreOptions options)
 {
     this.Options = options;
 }
예제 #5
0
 public static MemoryAuthStoreOptions Add(this MemoryAuthStoreOptions options, IAuthTarget target, params IAuthActivity[] activities)
 {
     options.Items.Add(new AuthItem(target, activities));
     return(options);
 }