5

私はasp.net 4.5のテンプレートで、Google以外のすべての認証サンプルを秘密とclientidで渡します。私はどのように私のGoogle秘密とclientidを渡すことができますか?asp.net 4.5を使用するOAuthでclientidとシークレットを登録する

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

をそのテンプレートが付属して、次のようにサンプルコードがある: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(); 
    } 
} 
+0

なぜあなたはアプリのIDと秘密を渡したいのですか?これにより、ユーザーは認証され、データなしでデータを取得できます。 –

+0

こんにちはジェイド、私はトークンを格納し、認証に使用するクライアントアプリケーションにトークンを渡すことができるように、私はappIdと秘密が必要です。 –

+0

また、GoogleでIMAPクライアントを認証するにはトークンが必要です。それがここでOAuthを使用する主な目的です。 –

答えて

4

私はOAuthWebSecurityクラスのsource codeを見ていました。その実装はOpenIdを使用していないOAuthされているため、Googleの認証クライアントがAPPID/AppSecretを必要としない

理由があります。

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

関連する問題