0

I recently set up a Realm Object Server on Digital Ocean. I configured the server to use Facebook authentication.

I then wrote a simple iOS App to login with the Facebook iOS SDK and then I use Realm to login like this

let credentials = SyncCredentials.facebook(token: FBSDKAccessToken.current().tokenString)
SyncUser.logIn(with: credentials, server: URL(string: "http://000.000.00:9080/")!, onCompletion: { (user, error) in
   print("User: \(user)")
   print("Error: \(error)")
})

It works! Cool. I see these default realm's on my Object Server.

enter image description here

My understanding of these realms is that they are there for me to configure administrator / developer access. Am I wrong about this?

The User I just created got added to the /_admin realm. Why? They are a user of my app, not any sort of admin. If this is the appropriate place for the user can I add other data under /_admin -> User object? How do I prevent the user from being created under /_admin and created under my own User object? Am I not understanding the Realm Object Server Architecture in this case?

Dávid Pásztor
  • 51,403
  • 9
  • 85
  • 116
Jon Vogel
  • 5,244
  • 1
  • 39
  • 54

1 Answers1

0

These realms are maintained by Realm Object Server and you should avoid writing to them in any way at the risk of breaking things on the server. It is my understanding that reading from them is ok.

The user shows up in /__admin not because the user is an administrator, but because that's the data storage ROS uses to store its users.

If you are familiar with a relational database like SQL Server, this is equivalent to system-maintained tables like sysusers and syslogins.

Chad Gilbert
  • 36,115
  • 4
  • 89
  • 97
  • So after I call `SyncUser` with the Facebook credentials I should just let ROS do its thing with that new account? Then it's up to me to maintain my own Realm of users on the ROS? – Jon Vogel Feb 01 '18 at 19:15
  • That sounds like the safest bet to avoid changing a ROS-managed realm in some way that causes problems down the road. – Chad Gilbert Feb 01 '18 at 19:26