Comments (5)
you need to debug I guess. Maybe because the Katana logger factory is not set up.
—
cheers
Dominick Baier
On 23 Sep 2015 at 00:24:08, jraadt ([email protected]) wrote:
I have everything working with AccessTokenValidation 1.2.2, but when I upgrade the library to 2.2.0 I get the following NullReferenceException. I don't have this running on the same server as the IdentityServer.
at IdentityServer3.AccessTokenValidation.ValidationEndpointTokenProvider..ctor(IdentityServerBearerTokenAuthenticationOptions options, ILoggerFactory loggerFactory) in c:\etc\Dropbox\identity\IdentityServer3\AccessTokenValidation\source\AccessTokenValidation\Plumbing\ValidationEndpointTokenProvider.cs:line 39
at Owin.IdentityServerBearerTokenValidationAppBuilderExtensions.ConfigureEndpointValidation(IdentityServerBearerTokenAuthenticationOptions options, ILoggerFactory loggerFactory) in c:\etc\Dropbox\identity\IdentityServer3\AccessTokenValidation\source\AccessTokenValidation\IdentityServerBearerTokenValidationAppBuilderExtensions.cs:line 92
at Owin.IdentityServerBearerTokenValidationAppBuilderExtensions.UseIdentityServerBearerTokenAuthentication(IAppBuilder app, IdentityServerBearerTokenAuthenticationOptions options) in c:\etc\Dropbox\identity\IdentityServer3\AccessTokenValidation\source\AccessTokenValidation\IdentityServerBearerTokenValidationAppBuilderExtensions.cs:line 55
at MyProject.Startup.<>c__DisplayClass1_0.<Configure>b__2(IAppBuilder builder) in C:\MyApp\src\MyProject\Startup.cs:line 55
at MyProject.IApplicationBuilderExtensions.<>c__DisplayClass0_0.<UseAppBuilder>b__1(Func`2 next) in C:\MyApp\src\MyProject\IApplicationBuilderExtensions.cs:line 21
at Microsoft.AspNet.Builder.OwinExtensions.<>c__DisplayClass0_1.<UseOwin>b__1(RequestDelegate next1)
at Microsoft.AspNet.Builder.Internal.ApplicationBuilder.Build()
at Microsoft.AspNet.Hosting.Internal.HostingEngine.BuildApplication()
at Microsoft.AspNet.Hosting.Internal.HostingEngine.Start()
at Microsoft.AspNet.Loader.IIS.RuntimeHttpApplication.ApplicationStart(IHttpApplication application)
at Microsoft.AspNet.Loader.IIS.HttpApplicationBase.InvokeApplicationStart(IHttpApplication application)
It's erroring on the builder.UseIdentityServerBearerTokenAuthentication(options); part of my Startup.cs file:
public void Configure(IApplicationBuilder app, ILoggerFactory loggerfactory)
{
...
var options = new IdentityServerBearerTokenAuthenticationOptions
{
Authority = "http://my-identity-server/oauth",
RequiredScopes = new string[] { "my_api" }
};
app.UseAppBuilder(builder => { builder.UseIdentityServerBearerTokenAuthentication(options); }, "WebApi");
app.UseMvc();
}
And here is the IApplicationBuilderExtensions class:
public static class IApplicationBuilderExtensions
{
public static IApplicationBuilder UseAppBuilder(this IApplicationBuilder app, Action configure, string owinHostAppName)
{
app.UseOwin(addToPipeline =>
{
addToPipeline(next =>
{
var builder = new Microsoft.Owin.Builder.AppBuilder();
builder.Properties["builder.DefaultApp"] = next;
builder.Properties["host.AppName"] = owinHostAppName;
configure(builder);
var appFunc = builder.Build(typeof(Func<IDictionary<string, object>, Task>)) as Func<IDictionary<string, object>, Task>;
return appFunc;
});
});
return app;
}
}
—
Reply to this email directly or view it on GitHub.
from identityserver3.accesstokenvalidation.
Thanks for the quick response. I ended trying the ASP.NET 5 OAuth 2.0 middleware that supports JWTs out of the box (app.UseOAuthBearerAuthentication) and it seemed to work fine.
from identityserver3.accesstokenvalidation.
But it does not do scope verification. See my asp5 sample.
from identityserver3.accesstokenvalidation.
It was your asp5 sample that lead me down the path to the "out of the box" solution so I also included your RequiredScopesMiddleware. The big difference I'm having between these solutions is the AccessTokenValidation returned nice 401s when validation failed, such as token expiration. The "out of the box" throws an SecurityTokenExpiredException which returns a 500. I tried to catch that exception, but it seems that same class with the same classpath also exists in your IdentityModel package, which I also need in this project. So I couldn't figure out a way to use SecurityTokenExpiredException since it exists in both Microsoft and your libraries with the same classpath.
from identityserver3.accesstokenvalidation.
Open an issue at github/aspnet in the security repo. Sounds like a bug to me
Sent from my iPad
On 24 Sep 2015, at 20:59, jraadt [email protected] wrote:
It was your asp5 sample that lead me down the path to the "out of the box" solution so I also included your RequiredScopesMiddleware. The big difference I'm having between these solutions is the AccessTokenValidation returned nice 401s when validation failed, such as token expiration. The "out of the box" throws an SecurityTokenExpiredException which returns a 500. I tried to catch that exception, but it seems that same class with the same classpath also exists in your IdentityModel package, which I also need in this project. So I couldn't figure out a way to use SecurityTokenExpiredException since it exists in both Microsoft and your libraries with the same classpath.
—
Reply to this email directly or view it on GitHub.
from identityserver3.accesstokenvalidation.
Related Issues (20)
- Restrict issuer when using discovery document HOT 1
- Access token validation gives no indication when a token has failed HOT 1
- How to debug/trace if validation fails
- Unexpected file version of IdentityServer3.AccessTokenValidation involved in build warning HOT 2
- NotImplemented exception on Mono HOT 1
- Performance issues with ValidationMode.Local HOT 6
- Access token validation with legacy IIS hosted web API
- Customize Error Handling for HTTP Calls.
- Add UserInfo claims to User.Claims HOT 4
- 401 While using IdentityServer and the protected WebApi in the same app
- 2.15 causes deadlocks/hangs under heavy load HOT 10
- Adding option for configuring IntrospectionEndpoint
- Web Api with IS3 authenticate with IS4 Server HOT 2
- AccessTokenValidation - HTTPClient Socket connection timeouts HOT 1
- Set AccessToken Validation on a .net wepapi 2 with Identity server 4 HOT 1
- TypeLoadException when we use Microsoft.Owin 4 HOT 5
- Strict dependency on IdentityModel (>= 1.9.2 && < 2.0.0) makes upgrade to IdentityModel 2.12.0 not possible
- Define multiple issuers in TokenValidationParameters
- Sending JWT token to resource server - permission denied HOT 10
- How to know Identity server is down using app.UseIdentityServerBearerTokenAuthentication( New IdentityServerBearerTokenAuthenticationOptions() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from identityserver3.accesstokenvalidation.