@@ -41,6 +41,7 @@ const (
41
41
testVersion = "test-version"
42
42
defaultIDToolkitV1Endpoint = "https://identitytoolkit.googleapis.com/v1"
43
43
defaultIDToolkitV2Endpoint = "https://identitytoolkit.googleapis.com/v2"
44
+ secondFactorIdentifier = "aaaaaaaa-1111-bbbb-2222-cccccccccccc"
44
45
)
45
46
46
47
var (
@@ -466,6 +467,12 @@ func TestVerifyIDToken(t *testing.T) {
466
467
if ft .UID != ft .Subject {
467
468
t .Errorf ("UID = %q; Sub = %q; want UID = Sub" , ft .UID , ft .Subject )
468
469
}
470
+ if ft .Firebase .SignInSecondFactor != "totp" {
471
+ t .Errorf ("SignInSecondFactor = %q; want = %q" , ft .Firebase .SignInSecondFactor , "totp" )
472
+ }
473
+ if ft .Firebase .SecondFactorIdentifier != secondFactorIdentifier {
474
+ t .Errorf ("SecondFactorIdentifier = %q; want = %q" , ft .Firebase .SecondFactorIdentifier , secondFactorIdentifier )
475
+ }
469
476
}
470
477
471
478
func TestVerifyIDTokenFromTenant (t * testing.T ) {
@@ -1362,8 +1369,10 @@ func getIDTokenWithSignerAndKid(signer cryptoSigner, kid string, p mockIDTokenPa
1362
1369
"auth_time" : testClock .Now ().Unix () - 100 ,
1363
1370
"sub" : "1234567890" ,
1364
1371
"firebase" : map [string ]interface {}{
1365
- "identities" : map [string ]interface {}{},
1366
- "sign_in_provider" : "custom" ,
1372
+ "identities" : map [string ]interface {}{},
1373
+ "sign_in_provider" : "custom" ,
1374
+ "sign_in_second_factor" : "totp" ,
1375
+ "second_factor_identifier" : secondFactorIdentifier ,
1367
1376
},
1368
1377
"admin" : true ,
1369
1378
}
0 commit comments