Is it possible to validate Firebase's authToken every time my Swift app makes a request?
P粉037215587
P粉037215587 2023-07-30 16:37:18
0
1
659
<p>I'm developing a backend for my iOS and Mac apps. I used Firebase AuthUI to set up Apple Sign In. I'm validating authToken on login in PHP. What is the best way to securely protect other endpoints? Is it possible to validate Firebase's $authToken on every request? <br /><br />I'm wondering if I should always use my own appToken or use Firebase's authToken. </p><p><br /></p>
P粉037215587
P粉037215587

reply all(1)
P粉545218185

Since ID tokens are immutable and valid until their expiration date, many backends for Firebase decode and validate the ID token obtained from Firebase and then cache the result - using (hash value) ID token as the key and the decoded token as the value. This allows them to check on each call whether the decoded ID token is still valid/not expired without having to decode it every time (which is a more expensive operation).

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template