Skip to content

Instantly share code, notes, and snippets.

View LodewijkSioen's full-sized avatar

Lodewijk Sioen LodewijkSioen

View GitHub Profile
@kroymann
kroymann / IdentityServerAzureKeyVault.cs
Last active October 15, 2024 15:24
This code extends IdentityServer4 so that the token signing credentials and validation keys can be loaded from a certificate stored in an Azure Key Vault, and provides everything needed to automatically handle seamless rollover to new versions of the certificate without requiring any reboot of the application.
using IdentityServer4.Stores;
using Microsoft.Azure.KeyVault;
using Microsoft.Azure.Services.AppAuthentication;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using Microsoft.IdentityModel.Tokens;
using System;
using System.Collections.Generic;
@mshwery
mshwery / app.js
Last active May 6, 2024 05:27
Gulp + Browserify + requiring .html templates + Knockout web components
var ko = require('knockout');
ko.components.register('simple-name', require('./components/simple-name/simple-name.js'));
ko.applyBindings({ userName: ko.observable() });
@jlew-cs
jlew-cs / ServiceBusEndpoint.cs
Created January 4, 2013 14:59
ServiceHost uses a strategy similar to TopShelf "shelving", where the presence of a directory Foo containing a config file Foo.config will cause an AppDomain to be created named "Foo" that loads that config file and calls an endpoint initialization routine. CAVEAT: We use this *only* in development environments, it has in no way been proven in a…
// This class is actually in a different assembly & namespace fro ServiceHost in my solution,
// you may or may not need that.
namespace ServiceHost
{
public class ServiceBusEndpoint
{
public static void ConfigureNewInstanceForAppDomain()
{
// Call NSB configuration
Configure.With()
@DamianEdwards
DamianEdwards / gist:4032179
Created November 7, 2012 15:14
Some Model Binding helpers for ASP.NET Web Forms 4.5
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.ModelBinding;
namespace VS11BetaTAPWebForms