5

asp.net 4.5 テンプレートで、google pass 以外のすべての認証サンプルが secret と clientid にあることに気付きました。Google シークレットとクライアント ID を渡すにはどうすればよいですか? Brock は、私がフォローしているここで良い議論をしています:

http://info.develop.com/blogs/bid/232864/ASP-NET-Using-OAuthWebSecurity-without-SimpleMembership#.UNuBh2_Adv9

テンプレートに付属するサンプルコードは次のとおりです。

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();
    }
}
4

1 に答える 1

4

クラスのソースコードを見てみました。OAuthWebSecurity

Google の認証クライアントが AppId/AppSecret を必要としない理由は、その実装がOAuthではなくOpenIdを使用しているためです。

Google で OAuth を使用する場合は、独自のクライアントを作成する必要があります (少なくとも現時点では)。

于 2013-01-27T20:24:45.787 に答える