Skip to content
This repository has been archived by the owner on May 13, 2023. It is now read-only.

Send Valid User Access Token to Realtime Server #28

Closed
w3b6x9 opened this issue Nov 29, 2021 · 2 comments · Fixed by #36
Closed

Send Valid User Access Token to Realtime Server #28

w3b6x9 opened this issue Nov 29, 2021 · 2 comments · Fixed by #36
Labels
bug Something isn't working

Comments

@w3b6x9
Copy link
Member

w3b6x9 commented Nov 29, 2021

Feature request

Realtime server is now checking every minute to verify the validity of the user access token and storing updated user information from the JWT to Realtime's subscription table (used by Realtime WALRUS).

Describe the solution you'd like

  1. Realtime client pushes the user access token to all channels every heartbeat, which defaults to 30 seconds (see ref, ref, and ref).
  2. Supabase client sends latest and valid user access token on auth events SIGNED_IN and TOKEN_REFRESHED (see ref)*.
  3. Supabase client removes all subscriptions on auth event SIGNED_OUT (see ref)*.

*fix: improve auth for realtime row level security #303

Additional context

Realtime Security (WALRUS) will be launched very soon so we'll mention that additional Supabase client libs, like this one, will be compatible with the new Realtime some time in the near future.

@bdlukaa bdlukaa transferred this issue from supabase/supabase-dart Dec 1, 2021
@w3b6x9
Copy link
Member Author

w3b6x9 commented Dec 23, 2021

There's a recent realtime-js fix that will update the user_token used for channel (subscription) reconnection: supabase/realtime-js#126

@KirioXX
Copy link

KirioXX commented Jan 4, 2022

Hi,
I just wanted to ask is there any news on this issue or can I help with anything to get this resolved?
Because we are seeing exceptions thrown and the stream dying, that seem to be related to the token expiring.
Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants