-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
[REQUIRED] Step 2: Describe your environment
- Xcode version: 9.3.1
- Firebase SDK version: 4.33.0
- Firebase Component: Auth
- Component version: 5.0.0
[REQUIRED] Step 3: Describe the problem
The date fields of ID tokens are incorrectly decoded in current epoch.
See [FIRUser parseIDToken:error:]
NSDate *expDate =
[NSDate dateWithTimeIntervalSinceNow:[tokenPayloadDictionary[@"exp"] doubleValue]];
They should be decoded in UNIX epoch - see https://firebase.google.com/docs/auth/admin/verify-id-tokens
exp | Expiration time | Must be in the future. The time is measured in seconds since the UNIX epoch.
Since we are now in 2018 and epoch is 1970, we end up ~48 years in the future.
Steps to reproduce:
Get an ID token with [FIRUser getIDTokenWithCompletion:]
Observe that in parseIDToken the expiration date (and other dates) ends up in 2066.