我注意到在 asp.net 4.5 模板中,除了 google 之外的所有授权示例都传入了 secret 和 clientid。如何传递我的谷歌密码和客户端 ID?Brock 在这里有一个很好的讨论,我正在关注:
模板附带的示例代码如下。
internal static class AuthConfig
{
public static void RegisterOpenAuth()
{
// See http://go.microsoft.com/fwlink/?LinkId=252803 for details on setting up this ASP.NET
// application to support logging in via external services.
//OpenAuth.AuthenticationClients.AddTwitter(
// consumerKey: "your Twitter consumer key",
// consumerSecret: "your Twitter consumer secret");
//OpenAuth.AuthenticationClients.AddFacebook(
// appId: "your Facebook app id",
// appSecret: "your Facebook app secret");
//OpenAuth.AuthenticationClients.AddMicrosoft(
// clientId: "your Microsoft account client id",
// clientSecret: "your Microsoft account client secret");
// OpenAuth.AuthenticationClients.AddGoogle();
}
}