IdentityServer / IdentityServer3.AccessTokenValidation

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

don't connect the authority during pipeline build #57

Closed tugberkugurlu closed 8 years ago

tugberkugurlu commented 8 years ago

It currently tries to connect to authority in several cases (I guess) and it blows up if the authority is not there at that time. This is especially a problem on the dev time like when you use docker compose to get your solution up and running and cannot guarantee which one will start before.

The solution would be to wrap the logic inside Lazy and reach out to its value on first request.

leastprivilege commented 8 years ago

but do you want to find out that something is wrong at startup time - or some time later?

tugberkugurlu commented 8 years ago

some time later. In my case, it will blow up 80% of the time for me unless I do some horrible hacks :smile:

If not acceptable to do this by default, it would be good to have an option to evaluate everything lazily through options.

leastprivilege commented 8 years ago

I like the idea of having an option for lazy loading...PR? ;)

tugberkugurlu commented 8 years ago

yep, will send one.

yuriyostapenko commented 8 years ago

I was about to suggest the same thing. At least in my apps, it's not ok for this to prevent application from starting. I would very much want the protected resources to return 401 until the authority is up and let everything else work (including health monitoring, etc...).

leastprivilege commented 8 years ago

yep agreed it would be useful to have an option for lazy loading - but I won't have resources to implement it any time soon.

leastprivilege commented 8 years ago

PR anyone? :)

tugberkugurlu commented 8 years ago

I will do that.

brockallen commented 8 years ago

Can this be closed now?

leastprivilege commented 8 years ago

There is a delay load option now. — cheers Dominick Baier