Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions FirebaseAdmin/FirebaseAdmin/AppOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ internal AppOptions(AppOptions options)
this.ProjectId = options.ProjectId;
this.ServiceAccountId = options.ServiceAccountId;
this.HttpClientFactory = options.HttpClientFactory;
this.TokenCertUrl = options.TokenCertUrl;
}

/// <summary>
Expand Down Expand Up @@ -66,5 +67,10 @@ internal AppOptions(AppOptions options)
/// Gets or sets the HttpClientFactory to use when making Firebase requests.
/// </summary>
public HttpClientFactory HttpClientFactory { get; set; }

/// <summary>
/// Gets or sets the TokenCertUrl to use custom public key url.
/// </summary>
public string TokenCertUrl { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,11 @@ internal static FirebaseTokenVerifier CreateIdTokenVerifier(
"Must initialize FirebaseApp with a project ID to verify ID tokens.");
}

var tokenCertUrl = string.IsNullOrEmpty(app.Options.TokenCertUrl)
? IdTokenCertUrl
: app.Options.TokenCertUrl;
var keySource = new HttpPublicKeySource(
IdTokenCertUrl, SystemClock.Default, app.Options.HttpClientFactory);
tokenCertUrl, SystemClock.Default, app.Options.HttpClientFactory);
var args = CreateIdTokenVerifierArgs();
args.ProjectId = projectId;
args.TenantId = tenantId;
Expand Down