2017-10-12 2 views

Antwort

1

Sie müssen es als Teil eines benutzerdefinierten AuthenticationMiddleware hinzufügen.

public class CustomAuthMiddleware : AuthenticationMiddleware<OpenIdConnectAuthenticationOptions> 
{ 
    public CustomAuthMiddleware(OwinMiddleware nextMiddleware, OpenIdConnectAuthenticationOptions authOptions) 
     : base(nextMiddleware, authOptions) 
    { } 

    protected override AuthenticationHandler<OpenIdConnectAuthenticationOptions> CreateHandler() 
    { 
     return new XDOpenIdAuthHandler(yourLogger); 
    } 
} 

mit ihm dann im Startup.Auth zum Beispiel:

public partial class Startup 
{ 
    // For more information on configuring authentication, please visit https://go.microsoft.com/fwlink/?LinkId=301864 
    public void ConfigureAuth(IAppBuilder app) 
    { 
     app.Use<CustomAuthMiddleware>(new OpenIdConnectAuthenticationOptions()); 
    } 
} 

Beachten Sie, jedoch, dass die Owin Pipeline es sonst nicht den Standard OpenIdConnectAuthenticationMiddleware enthalten muss, wird nach wie vor als Teil der Anforderung aufgerufen Rohr.

Verwandte Themen