Home > OS >  remove data from Firebase ID token
remove data from Firebase ID token

Time:07-26

The data obtained from BaseAuth.verifyIdToken() contains, among other properties, the phone_number and email properties (like detailed here). It can be obtained with DecodedIdToken.phone_number.

What I want to do is hide these fields, so they wouldn't be passed at all in the token. Is there a way to do that? from what I've seen here, you can add data using a custom token, but I couldn't find any information as for the other way around.

thanks!

CodePudding user response:

The ID token that Firebase Authentication generates contains all information it has for that user. There is no way to hide part of the information from the token.

If you don't want certain properties to be present in the token you should leave them out of the Firebase Authentication profile for that user. For example, you could store them elsewhere, like in one of Firebase's cloud-hosted databases.

  • Related