Authentication from another device

I’m using Realm EmailPassword for authentication, how can i use a previous logged device to authenticate in new one ?

Thanks

Carbonete

Hi @Sergio_Carbonete, I’m not sure what you mean by “user a previous logged device to authenticate this one”.
Do you want the two devices to have access to the same data?

Hi, explain better.

I use Realm authentication using E-mail/Password , and SYNC to sync devices.
Imagine user first logging in Android, and when they will logging at Windows, i offer 2 options

  1. Use E-mail/Password
  2. Other device already logged, Android device show QR-CODE and Windows read it, most like Whatsapp Web and others applications.

It’s possible send User.AccessToken to other side and use it to made Login ?

Thanks

Now I understand what you’re trying to achieve. In this case you could use the API Keys provider (https://docs.mongodb.com/realm/sdk/dotnet/examples/manage-user-api-keys/).
In practice:

  • The user logs in on device 1 using Email/Password
  • Once the user is logged in, you can generate a user API key using the api from the link above
  • When the user needs to login on device 2, you generate a QR code with the api key on device 1, and then the user can read the QR code using the camera, get the key, and login on device 2

I hope that makes sense!

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.