Below is a Microsoft.IdentityModel configuration you might find in a web.config or app.config that hosts websites or webservices that leverage Claims based authentication and authorization. If your requirements require you to do this at runtime at the start of the app you can do the following.... void Application_Start(object sender, EventArgs e) { FederatedAuthentication.Ser... += new EventHandler<ServiceConf... ......