Skip to content

Instantly share code, notes, and snippets.

View tpeczek's full-sized avatar
:octocat:
Looking for inspiration

Tomasz Pęczek tpeczek

:octocat:
Looking for inspiration
View GitHub Profile
@tpeczek
tpeczek / JwtBearerMultipleJwaExtensions.cs
Last active May 27, 2018 10:22
Supporting multiple JWA and ES256 in ASP.​NET Core JWT bearer authentication
using System;
using System.Text;
using System.Security.Cryptography;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.IdentityModel.Tokens;
namespace Microsoft.Extensions.DependencyInjection
{
public static class JwtBearerMultipleJwaExtensions
@tpeczek
tpeczek / CloudFlareConnectingIpExtensions.cs
Last active August 5, 2024 21:22
ASP.NET Core middleware for CloudFlare Connecting IP support
using System;
using Microsoft.Extensions.Options;
using Microsoft.AspNetCore.HttpOverrides;
using Lib.AspNetCore.CloudFlareConnectingIp;
namespace Microsoft.AspNetCore.Builder
{
public static class CloudFlareConnectingIpExtensions
{
public static IApplicationBuilder UseCloudFlareConnectingIp(this IApplicationBuilder app)
@tpeczek
tpeczek / PostTunnelingMiddleware.cs
Created December 7, 2017 20:18
ASP.NET Core middleware for POST Tunneling support
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
namespace Demo.AspNetCore.PostTunneling.Middlewares
{
public class PostTunnelingMiddleware
@tpeczek
tpeczek / SslAccelerationMiddleware.cs
Created September 7, 2017 19:10
ASP.NET Core middleware for SSL Acceleration (Offloading) support
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.Options;
namespace Demo.AspNetCore.SslAcceleration.Middlewares
{
public class SslAccelerationOptions