Replies: 3 comments 12 replies
-
Before an actual dev kicks in, heh, what I will say is access tokens and refresh tokens are opaque to you the consumer, they're not yours to delve into, or to extract things from. They're for you to pass to the consuming service as they have been supplied to you. Those are flipping huge though. Feels a bit wrong, but who knows, I mean, it's Canada, could be both French and English in one :) Putting it in session feels like a reasonable thing to do, or using a reference cookie, which is, well, just putting it in session again. Have you checked with eHealth that these tokens are indeed the size they expect to return to you, just to rule out some weird error somewhere along the way? |
Beta Was this translation helpful? Give feedback.
-
On cross-targeting: I'm impressed you got this far. You're right that the stacks are quite different. I wonder how much code you're really sharing and if you'd be better off with two packages? Currently you have #if's around entire files. Make sure to remove any 2.2 package dependencies, those are now available in the shared framework in 3.x. |
Beta Was this translation helpful? Give feedback.
-
For a) CorrelationId, you're only having this issue on Katana, it works on Core? It looks like you use the base class implementation of GenerateCorrelationId, but you customized the validation step with ValidateOurCorrelationId? Why not use the base ValidateCorrelationId? Or is that what you meant about pulling the code out for debugging? Your code seems to be using the same StateCookie for correlation and state? These are different concepts and I think trying to merge them is what's breaking you. The correlation cookie is just a unique id for that handshake that mitigates some CSRF(?) attacks. The handshake state can flow in the OAuth state field, it doesn't need a cookie. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Continued from a Twitter stub discussion: https://twitter.com/djbyter/status/1319339978346926081
I've created a library which multi-targets both net full and net core frameworks to allow for a common API (as much as possible) when implementing this in either platform, here: https://github.com/Clinical-Support-Systems/oneid-oauth-middleware
It works, per say, but I've had to work around some issues because it's been pretty difficult finding documentation as things have been shifting in this arena over the last few years.
Current problems:
a) CorrelationId, can't validate. I can't for the life of me understand why this can't be validated. You'll see here that I've pulled out the related code so I can step through but it is always reporting "correlation cookie and state property mismatch" and it's very unclear why. Obviously this line but during runtime, it's not clear. They look equal.
b) Due to this particular service, the tokens are massive. This is one of the biggest headaches. If I just blindly
SaveTokens
then I get header cookie size exceptions. I've replaced the data, but the ultimate result from the access_token endpoint isI get that there is a limit, and annoyingly I think almost everything in these tokens is required so I can't shave it. Even if I could due to the nature of the service there is dynamic content being returned in these tokens that might continue to push it over. You'll see here that I gave up and just started throwing the access_token in session but it smells to me. Now that I'm trying to use the refresh token, I can either throw that in session as well temporarily but I would like to understand if that's "normal" or if I just misunderstand something about how this works.
The primary inspiration was https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers and then worked backwards to make it work for net full.
Beta Was this translation helpful? Give feedback.
All reactions