403 when using Realtime library
Trying to use the realtime library (supabase-kt) but keep receiving a 403 when trying to emit/read values this way. I've checked the table off in publications for supabase_realtime. Checking Database -> Tables also shows Realtime is enabled for the table. Below is the code and my error:
@OptIn(SupabaseExperimental::class)
val queuedNotificationsFlow: Flow<List<Notification>> = supabaseClient.from(TABLE_NOTIFICATIONS).selectAsFlow(
Notification::id,
filter = FilterOperation("status", FilterOperator.EQ, "queued")
)9 Replies
checking realtime container logs, i see the following:
project=realtime-dev external_id=realtime-dev error_code=MalformedJWT [error] MalformedJWT: The token provided is not a valid JWT
i am creating my client with the service role key, locally. which is the Secret key
i think this has to do with the new keys not being jwts anymore, on local (when running supabase status)
is it not possible to get those old jwt values?https://github.com/supabase/supabase-js/issues/1568#issuecomment-3338107800
Talks about getting service_role key.
You should add CLI to your post.
Are you running the latest CLI? Hosted realtime works with the new SB keys but not sure if local dev does. But certainly if a few months older would not.
I don't use local dev, but had seen the transition issues on some of this for another user case. I won't be the one to follow up with.
latest cli, yup. updated today
i did some googling and saw some other users with a similar issues - a thread on reddit
will try to find it
So my link should at least let you get going with the old service_role key.
It works in parallel with sb_secret being used on the DB.
!
it worked
no erors anymore
thank you!!!
man i was going insane lol
It really should support the SB_secret by now, but not sure where they are at on rolling that in for realtime. OR you were doing something odd with the SB_secret one. It does work with the latest realtime server, just not sure if that is on the CLI.
i don't think i was doing anything weird with the sb_secret - i think its just issues with local dev for some reason.
Reddit
cgaaf's comment on "How to Configure Supabase's Local Development E...
Explore this conversation and more from the Supabase community
Also I see this which could be it....
So only available in Beta CLI release until this version is released.
