Environment
- firebase-admin-go: v4.20.0
Problem
Calling UpdateUser with an MFA factor whose EnrollmentTimestamp is non-zero fails with:
{
"error": {
"code": 400,
"message": "Invalid value at 'mfa.enrollments[0].enrolled_at' (type.googleapis.com/google.protobuf.Timestamp), Field 'enrolledAt', Invalid time format: Illegal trailing data in input string",
"errors": [
{
"message": "Invalid value at 'mfa.enrollments[0].enrolled_at' (type.googleapis.com/google.protobuf.Timestamp), Field 'enrolledAt', Invalid time format: Illegal trailing data in input string",
"reason": "invalid"
}
],
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "mfa.enrollments[0].enrolled_at",
"description": "Invalid value at 'mfa.enrollments[0].enrolled_at' (type.googleapis.com/google.protobuf.Timestamp), Field 'enrolledAt', Invalid time format: Illegal trailing data in input string"
}
]
}
]
}
}
Reproduction
user := (&auth.UserToUpdate{}).MFASettings(auth.MultiFactorSettings{
EnrolledFactors: []*auth.MultiFactorInfo{
{
UID: "someuid",
DisplayName: "My phone",
FactorID: "phone",
EnrollmentTimestamp: time.Now().Unix() * 1000,
Phone: &auth.PhoneMultiFactorInfo{PhoneNumber: "+11234567890"},
},
},
})
_, err := client.UpdateUser(ctx, "someuid", user)
// err: "Illegal trailing data in input string"
Setting EnrollmentTimestamp to 0 avoids the error.
Environment
Problem
Calling
UpdateUserwith an MFA factor whoseEnrollmentTimestampis non-zero fails with:Reproduction