Custom Auth (for ATprotocol)
hihi! trying to implement a custom auth provider, and for some reason isAuthenticated is false even tho in my
useAuthFromProviderX
function (and my auth provider) it's true
noticed this in the Clerk & Auth0 doc pages but not the Custom auth provider page - do I potentially need to add something to convex.json?
Debugging authentication If a user goes through the Auth0 login flow successfully, and after being redirected back to your page useConvexAuth gives isAuthenticated: false, it's possible that your backend isn't correctly configured. The convex.json file in your project directory contains a list of configured authentication providers. You must run npx convex dev or npx convex deploy after adding a new provider to sync the configuration to your backend.
12 Replies
pushed what I have right now - to log in you need an atproto/bluesky account but my provider does work 🙂 https://github.com/babecottage/atproto-convex/blob/main/hooks/useAuthFromATP.ts
GitHub
atproto-convex/useAuthFromATP.ts at main · babecottage/atproto-convex
Contribute to babecottage/atproto-convex development by creating an account on GitHub.
uh locally I also have my convex folder with a couple simple schemas but I haven't commited that yet
also my auth provider - getToken returns a (stringified?) JWT
GitHub
atproto-react/ATPProvider.tsx at main · babecottage/atproto-react
cute reusable helpers for ur besties' new favorite protocol - atproto-react/ATPProvider.tsx at main · babecottage/atproto-react
cc @Michal Srb
update: set up a whole buncha breakpoints and hit a dead end - it looks like WebSocketManager is receiving AuthError from the server when it calls Authenticate with my JWT. not sure what to try next!
the jwt seems to be valid but i'm at the edges of my knowledge with this stuff 🙂
@Indy @Michal Srb oop should i move this to the support channel? srry i can’t read
I also had a bunch of issues with Auth, not sure if this is helpful but this is what worked for me: https://discord.com/channels/1019350475847499849/1019350478817079338/1101687370610376744
Hey @jem , do you have auth configured on your backend? To do this you can run
npx convex auth add
with the appropriate arguments for your auth provider. They should be written to convex.json
and pushed to your backend with npx convex dev
or npx convex deploy
.@Michal Srb soooo maybe this just won’t work, but my auth provider hasn’t (currently) implemented oauth - i’m kinda hazy on it but it’s a login with a username & password in their React client, and it returns a JWT (which I wrapped in a provider and wrote a translator for it to work with ConvexClientWithAuth)
which is to say - i tried running convex add auth but i have no idea what to tell it
this is the main auth provider btw - babecottage/atproto-react is my wrapper for it https://github.com/bluesky-social/atproto/tree/main/packages/api
GitHub
atproto/packages/api at main · bluesky-social/atproto
Social networking technology created by Bluesky. Contribute to bluesky-social/atproto development by creating an account on GitHub.
@jem will follow up on Bluesky, if this is an ID token we should be able to make this work!
from looking into this a bit, sounds like this is a JWT but not an OpenID identity token, so not something that will work with Convex auth. That's what we need to check though, what does this JWT look like.
from one Bluesky team member's perspective this isn't supported yet, but that doesn't mean not to investigate
oops idk how i missed this. i can decode the JWT later today 🙂