Skip to content

Instantly share code, notes, and snippets.

@ShawInnes
Created February 26, 2014 07:07
Show Gist options
  • Save ShawInnes/9225022 to your computer and use it in GitHub Desktop.
Save ShawInnes/9225022 to your computer and use it in GitHub Desktop.
OWIN Authentication Startup.cs
using System;
using System.Threading.Tasks;
using Microsoft.Owin;
using Owin;
using Owin.Security.Providers.GitHub;
using Owin.Security.Providers.LinkedIn;
using Owin.Security.Providers.Yahoo;
using Owin.Security.Providers.Reddit;
using Microsoft.Owin.Security.WsFederation;
using Microsoft.Owin.Security.Cookies;
[assembly: OwinStartup(typeof(WebSite.Startup))]
namespace WebSite
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseGitHubAuthentication("", "");
app.UseLinkedInAuthentication("", "");
app.UseYahooAuthentication("", "");
app.UseRedditAuthentication("", "");
app.UseGoogleAuthentication();
app.UseMicrosoftAccountAuthentication("", "");
app.UseTwitterAuthentication("", "");
app.UseCookieAuthentication(
new CookieAuthenticationOptions
{
AuthenticationType =
WsFederationAuthenticationDefaults.AuthenticationType
});
app.UseWsFederationAuthentication(new WsFederationAuthenticationOptions
{
MetadataAddress = "https://login.windows.net/azurefridays.onmicrosoft.com/federationmetadata/2007-06/federationmetadata.xml",
Wtrealm = "http://myapps/WsFed_AAD1",
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment