Skip to content

Instantly share code, notes, and snippets.

@yuv4ik yuv4ik/Startup.cs
Created Mar 3, 2018

What would you like to do?
.NET Standard 2.0 WEB.Api Firebase bearer token validation
public class Startup
public Startup(IConfiguration configuration)
Configuration = configuration;
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
var firebaseProjectId = "xxxxxx";
.AddJwtBearer(options =>
options.Authority = $"{firebaseProjectId}";
options.TokenValidationParameters = new TokenValidationParameters
ValidateIssuer = true,
ValidIssuer = $"{firebaseProjectId}",
ValidateAudience = true,
ValidAudience = firebaseProjectId,
ValidateLifetime = true
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
if (env.IsDevelopment())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.