Anderson Fortaleza
Anderson Fortaleza

Reputation: 2459

How to step into a OWIN middleware in a package?

I have the following stack in my ASPNET 5 app startup:

appBuilder.UseIdentityServerBearerTokenAuthentication();
// That calls
app.UseValidationEndpoint();
// That calls
app.UseOAuthBearerAuthentication();
// That calls
app.Use(typeof(OAuthBearerAuthenticationMiddleware), app, options);

The final call adds OAuthBearerAuthenticationMiddleware to the middleware pipeline, this class overrrides the CreateHandler() method returning a new instance of OAuthBearerAuthenticationHandler class.

OAuthBearerAuthenticationHandler class is the class that deals with the bearer token and that's where I'm trying to step into. The problem is that I can only set a breakpoint at the Startup.Configure() method, and this method runs only once when the application starts.

Even in this circutsnace I have trued to step into OAuthBearerAuthenticationHandler using the original Katana source code that I have downloaded from CodePlex and loading appropriate symbols but for some reason the symbols won't give me information about the OAuthBearerAuthenticationHandler class.

I really need to see what's going on inside that class, in special into the AuthenticateCoreAsync() method, but I don't know how to capture a request and go through the pipeline stack and get to that class as Startup.Configure() is only called once and in my circunstance I only have a problem when I provice a bearer token. I hope I was clear enough to get an answer :)

Upvotes: 5

Views: 701

Answers (0)

Related Questions