Search code examples
firebaseoauthgoogle-cloud-firestoretoken

Storing Twitch Oauth Tokens in Firestore Database


I'm creating a web app in which user's can link their Twitch account. I'm using Firestore as my database. Is there a secure way to store the user's Twitch Oauth token in Firestore? If not, what is the proper way to store a token?

I don't want to create a new token each time they log in, as this requires them to go through the auth process again.


Solution

  • Is there a secure way to store the user's Twitch Oauth token in Firestore?

    Yes there is, using Cloud Firestore Security Rules. So you can store the Twitch Oauth token in your Firestore database and write the corresponding security rules so only authorized users can read/write it.