-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OAuth #42
base: main
Are you sure you want to change the base?
OAuth #42
Conversation
…back to the original page
Problem: to prevent CSRF, I'm using samesite=Strict on the cookie. However, this means that when a client redirects to the authz page for the first time, it doesn't "see" the cookie. We could probably fix it with an extra redirect hop, but can we do it without a redirect? Also, the authn->authz redirect is janky, there's a flash of white for the HTML redirect. Aside from adding CSS, not sure what to do about that. |
There's a problem with this approach: we request the client metadata document twice (if the scopes weren't already granted). Is that actually a problem though? perf-wise we can solve this with caching, and security-wise I'm not sure it's an issue. the full security checks will still be applied in the final run through the flow, before handing over the auth code to the client (i.e. I don't think there's any TOCTOU risk). We could request client metadata during PAR and store it alongside it???? but that means the request happens pre-auth... |
I think I can use HTTP 303 to solve the POST->GET redirect issues https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/303 |
Main outstanding issues:
I also had an idea. Since bsky.app has no built-in mechanism for managing oauth permissions and sessions, I was thinking of hacking up the "app password" list API and turning into a thing for revoking permissions granted to clients. |
I think for DPoP I'm going to want to add another middleware. If the |
I also want to refactor authentication into a middleware that conditionally populates |
We need to make sure that both service proxying and getServiceAuth can't bypass a lack of |
We need to make sure refreshSession/deleteSession only work for sessions started via password auth. And, we need to make the oauth-only refresh/delete endpoints work. |
Because I check for JTI revocation via db on every request (either password auth or oauth tokens), I'm wondering if there's much value in using JWTs in the first place (since I'm not really taking advantage of statelessness). What if I just use uuid tokens instead? I think I'll continue using JWTs for now but it's worth thinking about as a potential simplification for the future. |
It's happening. Will close #15
TODO: