2016-06-17 12 views
0

を働いていない:https://developers.google.com/identity/sign-in/web/Googleの記号との統合私はGoogleの記号を統合するために、このガイドに従っ

しかし、私はボタンで記号をクリックすると、ポップアップが来ると行くが、ユーザーの任意の情報を提供していません。

function onSignIn(googleUser) { 

    // Useful data for your client-side scripts: 
    var profile = googleUser.getBasicProfile(); 
    console.log("ID: " + profile.getId()); // Don't send this directly to your server! 
    console.log('Full Name: ' + profile.getName()); 
    console.log('Given Name: ' + profile.getGivenName()); 
    console.log('Family Name: ' + profile.getFamilyName()); 
    console.log("Image URL: " + profile.getImageUrl()); 
    console.log("Email: " + profile.getEmail()); 

    // The ID token you need to pass to your backend: 
    var id_token = googleUser.getAuthResponse().id_token; 
    console.log("ID Token: " + id_token); 
    }; 

私は何の情報も得ていません。

+0

コード全体がどのように見えますか? – Vlad

+0

@Vlad私はすでに問題を修正しました。 GoogleコンソールでクライアントIDを生成したのは間違いです。 –

答えて

0

「Project and Client IDの作成」の「Authorized JavaScript originins」フィールドのポート番号に正しいURLを使用して問題を解決しました。 また、プロジェクトのGoogle+ APIも有効にしました。

関連する問題