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