本文整理汇总了C#中IAppBuilder.UseSignInCookies方法的典型用法代码示例。如果您正苦于以下问题:C# IAppBuilder.UseSignInCookies方法的具体用法?C# IAppBuilder.UseSignInCookies怎么用?C# IAppBuilder.UseSignInCookies使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAppBuilder
的用法示例。
在下文中一共展示了IAppBuilder.UseSignInCookies方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConfigureAuth
// 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
// and to use a cookie to temporarily store information about a user logging in with a third party login provider
app.UseSignInCookies();
// Enable the application to use a cookie to store information for the signed in user
app.UseApplicationSignInCookie();
// Enable the application to use a cookie to temporarily store information about a user logging in with a third party login provider
app.UseExternalSignInCookie();
// 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();
}
示例2: ConfigureAuth
// 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
// and to use a cookie to temporarily store information about a user logging in with a third party login provider
app.UseSignInCookies();
// 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();
var settings = ConfigurationManager.AppSettings;
app.UseGitHubAuthentication(
settings["oauth.gitHub.clientId"],
settings["oauth.gitHub.clientSecret"]);
app.UseStackExchangeAuthentication(
settings["oauth.stackExchange.clientId"],
settings["oauth.stackExchange.clientSecret"],
settings["oauth.stackExchange.key"],
settings["oauth.stackExchange.site"]);
}
示例3: ConfigureAuth
// 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
// and to use a cookie to temporarily store information about a user logging in with a third party login provider
//var options = new Microsoft.Owin.Security.Cookies.CookieAuthenticationOptions() { LoginPath = "~/#/login" };
//Microsoft.Owin.Security.Cookies.
var o = new Microsoft.AspNet.Identity.Owin.IdentityAuthenticationOptions();
o.LoginPath = "/#/login";
app.UseSignInCookies(o);
// 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();
}
示例4: ConfigureAuthentication
public static void ConfigureAuthentication(IAppBuilder app)
{
app.UseSignInCookies();
var settings = ConfigurationManager.AppSettings;
app.UseGitHubAuthentication(
settings["oAuth.github.clientId"],
settings["oAuth.github.clientSecret"]);
app.UseTwitterAuthentication(
settings["oAuth.twitter.consumerKey"],
settings["oAuth.twitter.consumerSecret"]);
app.UseFacebookAuthentication(
settings["oAuth.facebook.appId"],
settings["oAuth.facebook.appSecret"]);
app.UseGoogleAuthentication();
}
示例5: ConfigureAuth
// 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
// and to use a cookie to temporarily store information about a user logging in with a third party login provider
app.UseSignInCookies();
// Uncomment the following lines to enable logging in with third party login providers
app.UseMicrosoftAccountAuthentication(
clientId: "0000000040105C6D",
clientSecret: "oWTp0B9uZsmz2JXeLBgzLeCkmgCGuhqq");
app.UseTwitterAuthentication(
consumerKey: "ufILPAEGVqBMzTDjjk2WUA",
consumerSecret: "FynEIIZ2Yyk8WBTP11gd9Vh4dogxoF9JSwmDr65bsEw" );
app.UseFacebookAuthentication(
appId: "578923398838715",
appSecret: "ea9e0826873f376dc242f0d187d4461b");
app.UseGoogleAuthentication();
}
示例6: ConfigureAuth
// Weitere Informationen zum Konfigurieren der Authentifizierung finden Sie unter "http://go.microsoft.com/fwlink/?LinkId=301864".
public void ConfigureAuth(IAppBuilder app)
{
// Anwendung für die Verwendung eines Cookies zum Speichern von Informationen für den angemeldeten Benutzer aktivieren
// und ein Cookie zum vorübergehenden Speichern von Informationen zu einem Benutzer zu verwenden, der sich mit dem Anmeldeanbieter eines Drittanbieters anmeldet.
app.UseSignInCookies();
// Auskommentierung der folgenden Zeilen aufheben, um die Anmeldung mit Anmeldeanbietern von Drittanbietern zu ermöglichen
//app.UseMicrosoftAccountAuthentication(
// clientId: "",
// clientSecret: "");
//app.UseTwitterAuthentication(
// consumerKey: "",
// consumerSecret: "");
//app.UseFacebookAuthentication(
// appId: "",
// appSecret: "");
//app.UseGoogleAuthentication();
}
示例7: ConfigureAuth
// For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301883
public void ConfigureAuth(IAppBuilder app)
{
// Enable the application to use a cookie to store information for the signed in user
// and also store information about a user logging in with a third party login provider.
// This is required if your application allows users to login
app.UseSignInCookies();
// Uncomment the following lines to enable logging in with third party login providers
//app.UseMicrosoftAccountAuthentication(
// clientId: "",
// clientSecret: "");
//app.UseTwitterAuthentication(
// consumerKey: "",
// consumerSecret: "");
app.UseFacebookAuthentication(
appId: "518499618229750",
appSecret: "e3ad316eb2106ab00b02b8e238442545");
app.UseGoogleAuthentication();
}
示例8: ConfigureAuth
// For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301883
public void ConfigureAuth(IAppBuilder app)
{
// Enable the application to use a cookie to store information for the signed in user
// and also store information about a user logging in with a third party login provider.
// This is required if your application allows users to login
app.UseSignInCookies();
// Uncomment the following lines to enable logging in with third party login providers
//app.UseMicrosoftAccountAuthentication(
// clientId: "",
// clientSecret: "");
//app.UseTwitterAuthentication(
// consumerKey: "",
// consumerSecret: "");
app.UseFacebookAuthentication(
appId: "196883313822996",
appSecret: "c91262c81b907e99cf297ed8ce80ac58");
//app.UseGoogleAuthentication();
}