chawki
(C.K)
September 12, 2020, 12:38pm
1
Is there any way to verify and get userId on back-end from the access token created by client-side Realm SDK?
My application using Realm authentication, I need to get the user Id to save user created post on back-end, I’m using Couchbase for my post data.
something like firebase admin does link
1 Like
Ian_Ward
(Ian Ward)
September 12, 2020, 5:01pm
2
@chawki I believe you can use an authentication trigger like so -
And then access user.id in context - not sure exactly what you are trying to do but triggers and functions should give you access to user data -
chawki
(C.K)
September 13, 2020, 5:29am
3
What I’m looking for is something similar to firebase admin.
Here how firebase admin works
when user sign with firebase authenticate, firebase creates an access token on the client side
We can send the access token to the server-side and with firebase admin, we decode the access token and get the user id.
How to implement this with Realm?
Ian_Ward
(Ian Ward)
September 13, 2020, 6:23am
4
Once you login you can call something like:
var myId = app.currentUser()!.identity!
chawki
(C.K)
September 13, 2020, 12:25pm
5
Thanks @Ian_Ward ,
This not what I’m looking for, I think I need to implement the user verification my self.
Eden_Webb
(Eden Webb)
January 15, 2021, 1:36am
6
@chawki Did you find a solution? I am in the same boat.
A node.js backend but using Realm for user management. When a user logs in, I can get the accessToken returned but Realm has not method for validating the accessToken for subsequent requests…
1 Like
@Eden_Webb , @chawki , were you able to find a nice workaround for this?
Eden_Webb
(Eden Webb)
February 13, 2021, 5:12pm
8
@Vlad_Dobrovolskiy No. Following this thread Verify Access Token server side - #2 by Sumedha_Mehta1 there are some suggestions of workarounds. It also mentions they are looking into as a feature.
system
(system)
Closed
March 2, 2021, 10:52pm
10
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.