Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Remove top level methods on IServiceCollection that configure authentication #1269

Closed
davidfowl opened this issue Jun 18, 2017 · 4 comments
Closed
Assignees
Milestone

Comments

@davidfowl
Copy link
Member

services.AddScheme is too general of a name to put on the top level container:

image

Is it even meaningful to add a scheme without adding the authentication service? Why isn't it an extension method off on an IAuthenticationBuilder or something similar.

services.AddAuthentication()
              .AddScheme(...)
@HaoK
Copy link
Member

HaoK commented Jun 18, 2017

Not a bad idea to switch to a builder pattern. Do we want to move everything under, i.e.?

services.AddAuthentication().AddScheme/Xyz()

@HaoK
Copy link
Member

HaoK commented Jun 18, 2017

So something like:
Authentication.Core has void services.AddAuthenticationCore() // unchanged
Authentication adds AuthenticationBuilder services.AddAuthentication() builder.AddScheme
Authentication.Xyz adds AuthenticationBuilder.AddXyz()

@davidfowl
Copy link
Member Author

davidfowl commented Jun 18, 2017

I was also thinking we should hang the services like cookie, jwt, etc off the builder.

services.AddAuthentication()
              .AddCookies(...)
              .AddTwitter(...)

@HaoK
Copy link
Member

HaoK commented Jun 18, 2017

Yup that's what I meant with the AddXyz.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants