Monta
Monta

Reputation: 1180

Code=17000 "The custom token format is incorrect. Please check the documentation."

I followed the steps described here : https://firebase.google.com/docs/auth/admin/create-custom-tokens

I am able to create custom tokens using the Firebase Admin SDK.

I send them back to the client iOS app to use like this :

Auth.auth().signIn(withCustomToken: customToken ?? "") { (user, error) in
  // ...
}

But I get this error :

Code=17000 "The custom token format is incorrect. Please check the documentation." UserInfo={NSLocalizedDescription=The custom token format is incorrect. Please check the documentation., error_name=ERROR_INVALID_CUSTOM_TOKEN}

I'm using Firebase Admin 5.2.0 and the Firebase iOS client 4.0.0

Any idea?

Upvotes: 6

Views: 8063

Answers (2)

Sudeep Prasad
Sudeep Prasad

Reputation: 101

After checking the token and its lifetime, it turned out that a mismatch in system-time was the problem in our case.

After setting the timezone and the time to 'automatic', the problem was solved.

Upvotes: 1

Israel
Israel

Reputation: 1454

I try a lot time to solve it.. and I found something interesting. The custom_toke end with "%3D%3D", this is not a valid, you need to replace is with "==".. and it will work good.

Upvotes: 0

Related Questions