You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The auth emulator seems to always generate a token where auth_time is null. This causes the auth emulator to throw "auth/internal-error" when calling getIdTokenResult.
This is most likely the bug causing #3671 and #3663
[REQUIRED] Environment info
firebase-tools: 9.16.1, 9.16.2, 9.16.3
Platform: Windows
[REQUIRED] Test case
Try calling getIdTokenResult in a client app that is connected to the latest version of firebase-tools's auth emulator. Notice the error that is thrown.
[REQUIRED] Steps to reproduce
Run npm run serve using firebase-tools 9.16.3
Run a client application that connects to the firebase auth emulator
Signup a new user
Call getIdTokenResult on that new user
[REQUIRED] Expected behavior
You are able to decode the user's token and retrieve their claims.
[REQUIRED] Actual behavior
"auth/internal-error" is thrown
If you breakpoint the line of code where "auth/internal-error" is thrown, you'll see that the error is thrown because auth_time is null in the decoded token.
@yuchenshi This bug may possibly have something to do with the PR I submitted a few weeks ago. Perhaps lastLoginAt is undefined?
The text was updated successfully, but these errors were encountered:
lovelle-cardoso
changed the title
Auth Emulator does not work in v9.16.1 or v9.16.2 because auth_time is null when token is generated
Auth Emulator does not work in v9.16.1, v9.16.2 or v9.16.3 because auth_time is null when token is generated
Aug 13, 2021
The auth emulator seems to always generate a token where auth_time is null. This causes the auth emulator to throw "auth/internal-error" when calling getIdTokenResult.
This is most likely the bug causing #3671 and #3663
[REQUIRED] Environment info
firebase-tools: 9.16.1, 9.16.2, 9.16.3
Platform: Windows
[REQUIRED] Test case
Try calling getIdTokenResult in a client app that is connected to the latest version of firebase-tools's auth emulator. Notice the error that is thrown.
[REQUIRED] Steps to reproduce
npm run serve
using firebase-tools 9.16.3[REQUIRED] Expected behavior
You are able to decode the user's token and retrieve their claims.
[REQUIRED] Actual behavior
"auth/internal-error" is thrown
If you breakpoint the line of code where "auth/internal-error" is thrown, you'll see that the error is thrown because auth_time is null in the decoded token.
@yuchenshi This bug may possibly have something to do with the PR I submitted a few weeks ago. Perhaps lastLoginAt is undefined?
#3611
If so, perhaps try changing these lines of code
firebase-tools/src/emulator/auth/operations.ts
Lines 1729 to 1734 in 8e8043b
to
The text was updated successfully, but these errors were encountered: