Skip to content

Instantly share code, notes, and snippets.

@mrnkr
Created April 8, 2020 03:05
Show Gist options
  • Save mrnkr/0fe8d39b89ce6e398dfc9b770dc8fa2d to your computer and use it in GitHub Desktop.
Save mrnkr/0fe8d39b89ce6e398dfc9b770dc8fa2d to your computer and use it in GitHub Desktop.
This is how to configure JwtBearer authentication in C# to use a firebase id token
services
.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options =>
{
options.Authority = "https://securetoken.google.com/firebase-project";
options.TokenValidationParameters = new TokenValidationParameters
{
ValidateIssuer = true,
ValidIssuer = "https://securetoken.google.com/firebase-project",
ValidateAudience = true,
ValidAudience = "firebase-project",
ValidateLifetime = true
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment