geoseb
geoseb

Reputation: 51

Flutter Realm authentication not working, RealmException : non-zero custom status code considered fatal

I'm trying by following the docs to register and then login with realm. Unfortunatly I got an error RealmException : non-zero custom status code considered fatal when trying to do : authProvider.registerUser(email, password) or : app.logIn(emailCred);

I created a repo to reproduce here (look for the _handleSubmitted function inside register_view or login_view files) : https://github.com/geosebas/flutter_realm_auth

You will just need a mongodb free tier account with an empty app and email/password auth enabled (with no confirm email and default reset function)

I'm new to both flutter and realm so the solution may be very simple, please help me !

Thanks

Upvotes: 0

Views: 1216

Answers (2)

Ben Perlmutter
Ben Perlmutter

Reputation: 131

I ran into the same error when running in the iOS debugger, and the issue was that I needed to add client network entitlements.

I added the following code to the files DebugProfile.entitlements and Release.entitlements:

<key>com.apple.security.network.client</key>
<true/>

This solution was inspired by a similar user issue with flutter firebase.

Upvotes: 1

geoseb
geoseb

Reputation: 51

I just finally got the solution !

By reading in details the doc, I saw that you cannot choose the GCP as a deployment region for app service, but my atlas cluster is in GCP, so by default when you create an app on app service, it will be on GCP and nothing (or at least user auth) will work.

IMHO, it’s a very annoying bug as you cannot debug anything and the error you will get mean nothing.

Have a nice day :slight_smile:

PS : Here the post on mongodb forum with a bit more details : https://www.mongodb.com/community/forums/t/flutter-realm-auth-not-working/176195

Upvotes: 1

Related Questions