@@ -68,7 +68,7 @@ private AppCheckTokenVerifier(Builder builder) {
6868 DecodedAppCheckToken verifyToken (String token ) throws FirebaseAppCheckException {
6969 SignedJWT signedJWT ;
7070 JWTClaimsSet claimsSet ;
71- String scopedProjectId = String .format ("projects/%s" , projectId );
71+ String projectName = String .format ("projects/%s" , projectId );
7272 String projectIdMatchMessage = " Make sure the App Check token comes from the same "
7373 + "Firebase project as the service account used to authenticate this SDK." ;
7474
@@ -88,10 +88,10 @@ DecodedAppCheckToken verifyToken(String token) throws FirebaseAppCheckException
8888 } else if (!signedJWT .getHeader ().getType ().getType ().equals ("JWT" )) {
8989 errorMessage = String .format ("The provided App Check token has invalid type header."
9090 + "Expected %s but got %s" , "JWT" , signedJWT .getHeader ().getType ().getType ());
91- } else if (!claimsSet .getAudience ().contains (scopedProjectId )) {
91+ } else if (!claimsSet .getAudience ().contains (projectName )) {
9292 errorMessage = String .format ("The provided App Check token has incorrect 'aud' (audience) "
9393 + "claim. Expected %s but got %s. %s" ,
94- scopedProjectId , claimsSet .getAudience ().toString (), projectIdMatchMessage );
94+ projectName , claimsSet .getAudience ().toString (), projectIdMatchMessage );
9595 } else if (!claimsSet .getIssuer ().startsWith (APP_CHECK_ISSUER )) {
9696 errorMessage = "invalid iss" ;
9797 } else if (claimsSet .getSubject ().isEmpty ()) {
0 commit comments