private void ConfigureIdentityProviders(IAppBuilder app, string signInAsType) { var wsFederation = new WsFederationAuthenticationOptions { AuthenticationType = "windows", Caption = "Windows", SignInAsAuthenticationType = signInAsType, MetadataAddress = "https://localhost:44333/windows", Wtrealm = "urn:idsrv3" }; app.UseWsFederationAuthentication(wsFederation); }
public static void ConfigureAdditionalIdentityProviders(IAppBuilder app, string signInAsType) { var windowsAuthentication = new WsFederationAuthenticationOptions { AuthenticationType = "windows", Caption = "Windows", SignInAsAuthenticationType = signInAsType, MetadataAddress = GlobalConfiguration.WinAdMetadataUri.ToString(), Wtrealm = "urn:idsrv3", Wreply = $"{GlobalConfiguration.AuthorityRoute}/callback", Notifications = GetWsFedAuthNotifications() }; app.UseWsFederationAuthentication(windowsAuthentication); }
// For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864 public void ConfigureAuth(IAppBuilder app) { // Enable the application to use a cookie to store information for the signed in user app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, AuthenticationMode = Microsoft.Owin.Security.AuthenticationMode.Active, LoginPath = new PathString("/Account/Login") }); // Use a cookie to temporarily store information about a user logging in with a third party login provider //app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie); // these two lines of code are needed if you are using any of the external authentication middleware app.Properties["Microsoft.Owin.Security.Constants.DefaultSignInAsAuthenticationType"] = "ExternalCookie"; app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = "ExternalCookie", AuthenticationMode = Microsoft.Owin.Security.AuthenticationMode.Passive }); //configure Antariksh ADFS middleware var antarikshADFS = new WsFederationAuthenticationOptions { MetadataAddress = "https://antariksh.cloudapp.net/FederationMetadata/2007-06/FederationMetadata.xml", AuthenticationType = "Antariksh ADFS", Caption = "Antariksh Domain", BackchannelCertificateValidator = null, //localhost Wreply = "https://localhost:44314/Account/LoginCallbackAntarikshAdfs", Wtrealm = "https://localhost:44314/Account/LoginCallbackAntarikshAdfs" }; //configure IndiaUniverse ADFS middleware var indiaUniverseADFS = new WsFederationAuthenticationOptions { MetadataAddress = "https://indiauniverse.cloudapp.net/FederationMetadata/2007-06/FederationMetadata.xml", AuthenticationType = "IndiaUniverse ADFS", Caption = "India Universe Domain", BackchannelCertificateValidator = null, //localhost Wreply = "https://localhost:44314/Account/LoginCallbackIndiaUniverseAdfs", Wtrealm = "https://localhost:44314/Account/LoginCallbackIndiaUniverseAdfs" }; app.Map("/Account", configuration => { configuration.UseWsFederationAuthentication(antarikshADFS); configuration.UseWsFederationAuthentication(indiaUniverseADFS); }); }
/// <summary> /// Adds the <see cref="WsFederationAuthenticationMiddleware"/> into the OWIN runtime. /// </summary> /// <param name="app">The <see cref="IAppBuilder"/> passed to the configuration method</param> /// <param name="wsFederationOptions">WsFederationAuthenticationOptions configuration options</param> /// <returns>The updated <see cref="IAppBuilder"/></returns> public static IAppBuilder UseWsFederationAuthentication(this IAppBuilder app, WsFederationAuthenticationOptions wsFederationOptions) { if (app == null) { throw new ArgumentNullException("app"); } if (wsFederationOptions == null) { throw new ArgumentNullException("wsFederationOptions"); } if (string.IsNullOrWhiteSpace(wsFederationOptions.TokenValidationParameters.ValidAudience)) { wsFederationOptions.TokenValidationParameters.ValidAudience = wsFederationOptions.Wtrealm; } return app.Use<WsFederationAuthenticationMiddleware>(app, wsFederationOptions); }
public static void ConfigureIdentityProviders(IAppBuilder app, string signInAsType) { var google = new GoogleOAuth2AuthenticationOptions { AuthenticationType = "Google", Caption = "Google", SignInAsAuthenticationType = signInAsType, ClientId = "767400843187-8boio83mb57ruogr9af9ut09fkg56b27.apps.googleusercontent.com", ClientSecret = "5fWcBT0udKY7_b6E3gEiJlze" }; app.UseGoogleAuthentication(google); var fb = new FacebookAuthenticationOptions { AuthenticationType = "Facebook", Caption = "Facebook", SignInAsAuthenticationType = signInAsType, AppId = "676607329068058", AppSecret = "9d6ab75f921942e61fb43a9b1fc25c63" }; app.UseFacebookAuthentication(fb); var twitter = new TwitterAuthenticationOptions { AuthenticationType = "Twitter", Caption = "Twitter", SignInAsAuthenticationType = signInAsType, ConsumerKey = "N8r8w7PIepwtZZwtH066kMlmq", ConsumerSecret = "df15L2x6kNI50E4PYcHS0ImBQlcGIt6huET8gQN41VFpUCwNjM" }; app.UseTwitterAuthentication(twitter); var adfs = new WsFederationAuthenticationOptions { AuthenticationType = "adfs", Caption = "ADFS", SignInAsAuthenticationType = signInAsType, MetadataAddress = "https://adfs.leastprivilege.vm/federationmetadata/2007-06/federationmetadata.xml", Wtrealm = "urn:idsrv3" }; app.UseWsFederationAuthentication(adfs); var aad = new OpenIdConnectAuthenticationOptions { AuthenticationType = "aad", Caption = "Azure AD", SignInAsAuthenticationType = signInAsType, Authority = "https://login.windows.net/4ca9cb4c-5e5f-4be9-b700-c532992a3705", ClientId = "65bbbda8-8b85-4c9d-81e9-1502330aacba", RedirectUri = "https://localhost:44333/core/aadcb" }; app.UseOpenIdConnectAuthentication(aad); }
// For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864 public void ConfigureAuth(IAppBuilder app) { // Enable the application to use a cookie to store information for the signed in user app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, CookieName = "smash-aut", AuthenticationMode = Microsoft.Owin.Security.AuthenticationMode.Active, LoginPath = new PathString("/Account/Login") }); // Enable the application to use a cookie to store information for the signed in user app.Properties["Microsoft.Owin.Security.Constants.DefaultSignInAsAuthenticationType"] = "ExternalCookie"; app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = "ExternalCookie", AuthenticationMode = Microsoft.Owin.Security.AuthenticationMode.Passive }); //configure Antariksh ADFS middleware var plexADFS = new WsFederationAuthenticationOptions { MetadataAddress = "https://antarikshplex.cloudapp.net/FederationMetadata/2007-06/FederationMetadata.xml", AuthenticationType = "Plex ADFS", Caption = "Plex Domain", BackchannelCertificateValidator = null, //localhost Wreply = "https://localhost:44301/Account/LoginCallbackIndiaPlextestAdfs", Wtrealm = "https://localhost:44301/Account/LoginCallbackIndiaPlextestAdfs" }; //configure IndiaUniverse ADFS middleware var plextestADFS = new WsFederationAuthenticationOptions { MetadataAddress = "https://plextestad.cloudapp.net/FederationMetadata/2007-06/FederationMetadata.xml", AuthenticationType = "Plextest ADFS", Caption = "plext test", BackchannelCertificateValidator = null, //localhost Wreply = "https://localhost:44301/Account/LoginCallbackIndiaPlextestAdfs", Wtrealm = "https://localhost:44301/Account/LoginCallbackIndiaPlextestAdfs" }; //add to pipeline //app.UseWsFederationAuthentication(plexADFS); app.Map("/Account", configuration => { configuration.UseWsFederationAuthentication(plexADFS); configuration.UseWsFederationAuthentication(plextestADFS); }); // Use a cookie to temporarily store information about a user logging in with a third party login provider //app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie); // Uncomment the following lines to enable logging in with third party login providers //app.UseMicrosoftAccountAuthentication( // clientId: "", // clientSecret: ""); //app.UseTwitterAuthentication( // consumerKey: "", // consumerSecret: ""); //app.UseFacebookAuthentication( // appId: "", // appSecret: ""); //app.UseGoogleAuthentication(); }
private static void ConfigureWsFederationServer(IAppBuilder app, string signInAsType) { var windowsAuthentication = new WsFederationAuthenticationOptions { AuthenticationType = "windows", Caption = "Windows", SignInAsAuthenticationType = signInAsType, MetadataAddress = "https://localhost:44300/", Wtrealm = "urn:win" }; app.UseWsFederationAuthentication(windowsAuthentication); }