@@ -68,7 +68,7 @@ private AppCheckTokenVerifier(Builder builder) {
68
68
DecodedAppCheckToken verifyToken (String token ) throws FirebaseAppCheckException {
69
69
SignedJWT signedJWT ;
70
70
JWTClaimsSet claimsSet ;
71
- String scopedProjectId = String .format ("projects/%s" , projectId );
71
+ String projectName = String .format ("projects/%s" , projectId );
72
72
String projectIdMatchMessage = " Make sure the App Check token comes from the same "
73
73
+ "Firebase project as the service account used to authenticate this SDK." ;
74
74
@@ -88,10 +88,10 @@ DecodedAppCheckToken verifyToken(String token) throws FirebaseAppCheckException
88
88
} else if (!signedJWT .getHeader ().getType ().getType ().equals ("JWT" )) {
89
89
errorMessage = String .format ("The provided App Check token has invalid type header."
90
90
+ "Expected %s but got %s" , "JWT" , signedJWT .getHeader ().getType ().getType ());
91
- } else if (!claimsSet .getAudience ().contains (scopedProjectId )) {
91
+ } else if (!claimsSet .getAudience ().contains (projectName )) {
92
92
errorMessage = String .format ("The provided App Check token has incorrect 'aud' (audience) "
93
93
+ "claim. Expected %s but got %s. %s" ,
94
- scopedProjectId , claimsSet .getAudience ().toString (), projectIdMatchMessage );
94
+ projectName , claimsSet .getAudience ().toString (), projectIdMatchMessage );
95
95
} else if (!claimsSet .getIssuer ().startsWith (APP_CHECK_ISSUER )) {
96
96
errorMessage = "invalid iss" ;
97
97
} else if (claimsSet .getSubject ().isEmpty ()) {
0 commit comments