-1

Object { error: "idpiframe_initialization_failed", details: "You have created a new client application that uses libraries for user authentication or authorization that will soon be deprecated. New clients must use the new libraries instead; existing clients must also migrate before these libraries are deprecated. See the Migration Guide for more information." }

Code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://apis.google.com/js/platform.js" async defer></script>
    <meta name="google-signin-client_id" content="674825315286-ttgml4tvkv7impl21b6cviggcp3j7eem.apps.googleusercontent.com">
    <title>Login</title>
</head>
<body>

    <div class="g-signin2" data-onsuccess="onSignIn"></div>

    <a href="#" onclick="signOut();">Sign out</a>
    <script>
    function signOut() {
        var auth2 = gapi.client.getAuthInstance();
        auth2.signOut().then(function () {
        console.log('User signed out.');
        });
    }
    </script>

    <script>
    function onSignIn(googleUser) {
        var profile = googleUser.getBasicProfile();
        console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
        console.log('Name: ' + profile.getName());
        console.log('Image URL: ' + profile.getImageUrl());
        console.log('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present.
      }
    </script>
    
</body>
</html>

i want to make google authentication with login and logout feature but an error like the one above, what i want to get is that login and logout feature

Thank You

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.