@@ -38,9 +38,6 @@ internal sealed class FirebaseTokenVerifier
3838 private const string FirebaseAudience = "https://identitytoolkit.googleapis.com/"
3939 + "google.identity.identitytoolkit.v1.IdentityToolkit" ;
4040
41- // See http://oid-info.com/get/2.16.840.1.101.3.4.2.1
42- private const string Sha256Oid = "2.16.840.1.101.3.4.2.1" ;
43-
4441 private static readonly IReadOnlyList < string > StandardClaims =
4542 ImmutableList . Create < string > ( "iss" , "aud" , "exp" , "iat" , "sub" , "uid" ) ;
4643
@@ -54,7 +51,7 @@ internal sealed class FirebaseTokenVerifier
5451
5552 internal FirebaseTokenVerifier ( FirebaseTokenVerifierArgs args )
5653 {
57- ProjectId = args . ProjectId . ThrowIfNullOrEmpty ( nameof ( args . ProjectId ) ) ;
54+ this . ProjectId = args . ProjectId . ThrowIfNullOrEmpty ( nameof ( args . ProjectId ) ) ;
5855 this . shortName = args . ShortName . ThrowIfNullOrEmpty ( nameof ( args . ShortName ) ) ;
5956 this . operation = args . Operation . ThrowIfNullOrEmpty ( nameof ( args . Operation ) ) ;
6057 this . url = args . Url . ThrowIfNullOrEmpty ( nameof ( args . Url ) ) ;
@@ -118,7 +115,7 @@ internal async Task<FirebaseToken> VerifyTokenAsync(
118115 + "project as the credential used to initialize this SDK." ;
119116 var verifyTokenMessage = $ "See { this . url } for details on how to retrieve a value "
120117 + $ "{ this . shortName } .";
121- var issuer = this . issuer + ProjectId ;
118+ var issuer = this . issuer + this . ProjectId ;
122119 string error = null ;
123120 if ( string . IsNullOrEmpty ( header . KeyId ) )
124121 {
@@ -142,9 +139,9 @@ internal async Task<FirebaseToken> VerifyTokenAsync(
142139 error = $ "Firebase { this . shortName } has incorrect algorithm. Expected RS256 but got "
143140 + $ "{ header . Algorithm } . { verifyTokenMessage } ";
144141 }
145- else if ( ProjectId != payload . Audience )
142+ else if ( this . ProjectId != payload . Audience )
146143 {
147- error = $ "{ this . shortName } has incorrect audience (aud) claim. Expected { ProjectId } "
144+ error = $ "{ this . shortName } has incorrect audience (aud) claim. Expected { this . ProjectId } "
148145 + $ "but got { payload . Audience } . { projectIdMessage } { verifyTokenMessage } ";
149146 }
150147 else if ( payload . Issuer != issuer )
@@ -174,7 +171,7 @@ internal async Task<FirebaseToken> VerifyTokenAsync(
174171 throw new FirebaseException ( error ) ;
175172 }
176173
177- await VerifySignatureAsync ( segments , header . KeyId , cancellationToken )
174+ await this . VerifySignatureAsync ( segments , header . KeyId , cancellationToken )
178175 . ConfigureAwait ( false ) ;
179176 var allClaims = JwtUtils . Decode < Dictionary < string , object > > ( segments [ 1 ] ) ;
180177
0 commit comments