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

Add/Remove/Configure Authentication Middleware at Runtime #1132

Closed

Description

@windischb

Hi!

Is it possible to add and remove AuthenticationMiddleware at Runtime?
I wan't to configure/add/remove OpenIdConnectAuthenticationProviders inside a WebGui.

I was thinking about storing the ProviderOptions in a Database, with the AuthenticationScheme as GUID.

In my special case i wan't to use IdentityServer4 for multiple Customers.
If an new Customer arrives, i will add a new "Provider" to the Database an register it as Middleware in the pipeline. On the other side, i have to unregister the Provider and delete from Database.

Or maybe is it possible to query the Database on every Challenge if the AuthenticationScheme exists??

Any Ideas?
I have the need to add/remove/configure OpenIdConnectAuthentication without recompile or restart the Asp.net Core WebApplication...

Br

Activity

  1. Tratcher commented on Feb 21, 2017

    @Tratcher
    Member

    Not today, @hoak is building this feature right now: #1113, your feedback would be appreciated.

  2. windischb commented on Feb 21, 2017

    @windischb
    Author

    Thanks!

  3. HaoK commented on Feb 21, 2017

    @HaoK
    Member

    I'll add a unit test today to make sure we support adding and removing schemes dynamically works in the new stack

  4. daboul commented on Feb 22, 2017

    @daboul

    Hi. I was wondering the exact same thing and just asked about it on SO.

    http://stackoverflow.com/questions/42365743/installing-a-new-middleware-at-runtime-in-asp-net-core

    I'll definitively give it a try when it's out.

    Thanks.

  5. HaoK commented on Feb 22, 2017

    @HaoK
    Member

    See d92d923 for what it currently looks like, basically its just associating a schemeName with a handlerType in a new service.

  6. added this to the 2.0.0 milestone on Feb 23, 2017
  7. Eilon commented on Feb 23, 2017

    @Eilon
    Contributor

    We need to carefully consider threading scenarios such as:

    1. Reader/writer scenarios to ensure no unusual exceptions get thrown during normal operations
    2. Consistency within a request to ensure that during a request the state doesn't change (could cause very weird side-effects)
  8. HaoK commented on Apr 13, 2017

    @HaoK
    Member

    Tracked via #1179

  9. JohnGalt1717 commented on Nov 20, 2018

    @JohnGalt1717

    Where's this at? Is this now possible? Is there documentation on how to do it? I need to be able to add/remove these via a UI without having to restart our api layer every time.

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions