IdentityServer / IdentityServer3.AccessTokenValidation

OWIN Middleware to validate access tokens from IdentityServer3
Apache License 2.0
90 stars 149 forks source link

Pass AuthenticationMode option when using ValidationMode.ValidationEndpoint #36

Closed KautskyLozanoV closed 9 years ago

KautskyLozanoV commented 9 years ago

I was trying to use OWIN Cookie Authentication for MVC with Active AuthenticationMode and UseIdentityServerBearerTokenAuthentication middleware for WebAPI with Passive AuthenticationMode but this option is never set when using ValidationEndpoint (here)

internal static void UseValidationEndpoint(this IAppBuilder app, IdentityServerBearerTokenAuthenticationOptions options)
        {
            if (options.EnableValidationResultCache)
            {
                if (options.ValidationResultCache == null)
                {
                    options.ValidationResultCache = new InMemoryValidationResultCache(options);
                }
            }

            app.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions
            {
                AccessTokenProvider = new ValidationEndpointTokenProvider(options),
                Provider = options.Provider,
            });
        }

It would be nice to have this options so we could use this middleware on a passive authentication mode

leastprivilege commented 9 years ago

should be fixed on dev / RC2