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 Firebase custom tokens generated by this library result in an auth error from the Firebase servers:
The custom token format is incorrect. Please check the documentation.
It appears this library is putting in extra attributes that are not put in via the Java SDK. Specifically, this puts in a kid and a typ attribute in the header that the Java SDK doesn't.
I tried generating a token manually without those attributes and it was accepted by Firebase. Through some more experimentation, it's the typ attribute that's causing Firebase to reject the token as invalid as it accepts it still with the kid in place.
It looks like all that needs to change is to remove the typ header. The fix would be to change: lib/src/auth/token_tenerator.dart
Around lines 68-70... from:
var builder =JsonWebSignatureBuilder()
..jsonContent = claims
..setProtectedHeader('typ', 'JWT')
..addRecipient(certificate.privateKey, algorithm:'RS256');
... to ...
var builder =JsonWebSignatureBuilder()
..jsonContent = claims
..addRecipient(certificate.privateKey, algorithm:'RS256');
The text was updated successfully, but these errors were encountered:
Version:
firebase_admin: ^0.2.0-dev.1
The Firebase custom tokens generated by this library result in an auth error from the Firebase servers:
It appears this library is putting in extra attributes that are not put in via the Java SDK. Specifically, this puts in a
kid
and atyp
attribute in the header that the Java SDK doesn't.I tried generating a token manually without those attributes and it was accepted by Firebase. Through some more experimentation, it's the
typ
attribute that's causing Firebase to reject the token as invalid as it accepts it still with thekid
in place.It looks like all that needs to change is to remove the
typ
header. The fix would be to change:lib/src/auth/token_tenerator.dart
Around lines 68-70... from:
... to ...
The text was updated successfully, but these errors were encountered: