You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a few issues with implementing the OAuth client in environments like CloudFlare and other WinterCG environments.
I have been able to circumvent these myself with a few tricks
Fetch.cache is not available, in @atproto/oauth-client we are using cache: 'no-cache' which isn't supported in CloudFlare, we could circumvent this by using cache-control: no-cache instead.
Fetch.redirect: error is not available, in @atproto/did-resolver we are using redirect: 'error' which does not work, we need to use manual or follow.
When we use a tool like KV we have to restore the state.dpopKey to a JoseKey (more a docs issue I guess) which can be done like kvResult.dpopKey = new JoseKey(kvResult.dpopKey.jwks);
The handle-resolvers currently available all require DNS which isn't supported, instead I've made
this could also be done with the DNS resolution of CloudFlare itself I reckon.
Expected behaviour
I mainly wanted to describe the issues and discuss them before jumping on pull requests. I'm not sure how to replace redirect: error however the other three look feasible.
The text was updated successfully, but these errors were encountered:
Describe the bug
There's a few issues with implementing the OAuth client in environments like CloudFlare and other WinterCG environments.
I have been able to circumvent these myself with a few tricks
@atproto/oauth-client
we are usingcache: 'no-cache'
which isn't supported in CloudFlare, we could circumvent this by usingcache-control: no-cache
instead.@atproto/did-resolver
we are usingredirect: 'error'
which does not work, we need to use manual or follow.KV
we have to restore thestate.dpopKey
to aJoseKey
(more a docs issue I guess) which can be done likekvResult.dpopKey = new JoseKey(kvResult.dpopKey.jwks);
Expected behaviour
I mainly wanted to describe the issues and discuss them before jumping on pull requests. I'm not sure how to replace
redirect: error
however the other three look feasible.The text was updated successfully, but these errors were encountered: