Rezultate 1 la 3 din 3

Subiect: Problema autentificare google!

Vizualizare arbore

  1. #3
    Avatarul lui sorbal
    sorbal este deconectat Junior SeoPedia
    Reputatie:
    0
    Data înscrierii
    6th August 2015
    Locaţie
    Bucuresti
    Vârstă
    33
    Posturi
    4
    Putere Rep
    0


    Implicit

    Gata am gasit si script!
    Multumesc!

    Cod:
    var apiKey = 'YOUR_API_KEY';
    var clientId = 'YOUR_WEB_CLIENT_ID.apps.googleusercontent.com';
    var scopes = 'profile';
    
    function initAuth() {
      gapi.client.setApiKey(apiKey);
      gapi.auth2.init({
          client_id: clientId,
          scope: scopes
      }).then(function () {
        // Listen for sign-in state changes.
        gapi.auth2.getAuthInstance().isSignedIn.listen(updateSigninStatus);
    
        signinButton.addEventListener("click", handleSigninClick);
      });
    }
    
    // Get authorization from the user to access profile info
    function handleSigninClick(event) {
      gapi.auth2.getAuthInstance().signIn().then(function() {
        makeApiCall();
      });
    }
    
    gapi.load('client:auth2', initAuth);
    
    // Load the API and make an API call.  Display the results on the screen.
    function makeApiCall() {
      gapi.client.load('people', 'v1', function() {
        var request = gapi.client.people.people.get({
          resourceName: 'people/me'
        });
        request.execute(function(resp) {
          var p = document.createElement('p');
          var name = resp.names[0].givenName;
          p.appendChild(document.createTextNode('Hello, '+name+'!'));
          document.body.appendChild(p);
        });
      });
      // Note: In this example, we use the People API to get the current
      // user's name. In a real app, you would likely get basic profile info
      // from the GoogleUser object to avoid the extra network round trip.
      console.log(auth2.currentUser.get().getBasicProfile().getGivenName());
    }
    Ultima modificare făcută de sorbal; 16th September 2016 la 21:03.

Informații subiect

Utilizatori care navighează în acest subiect

Momentan este/sunt 1 utilizator(i) care navighează în acest subiect. (0 membrii și 1 vizitatori)

Thread-uri Similare

  1. Problema google.ro
    De weebyseo în forumul Google
    Răspunsuri: 42
    Ultimul Post: 30th April 2015, 12:57
  2. Plugin de autentificare ajutor.
    De all3ss1o în forumul WordPress
    Răspunsuri: 2
    Ultimul Post: 21st April 2012, 22:56
  3. Script autentificare Yahoo
    De Seinfeld în forumul Server side
    Răspunsuri: 3
    Ultimul Post: 11th September 2008, 15:33
  4. Formular de autentificare/inregistrare (opinii pro si contra)
    De Gabriel Puscuta în forumul Bar, lobby...
    Răspunsuri: 2
    Ultimul Post: 4th November 2007, 22:08
  5. Googlebot, crawler, PDF, autentificare
    De add în forumul Google
    Răspunsuri: 5
    Ultimul Post: 19th July 2007, 10:57

Permisiuni postare

  • Nu puteţi posta subiecte noi.
  • Nu puteţi răspunde la subiecte
  • Nu puteţi adăuga ataşamente
  • Nu puteţi modifica posturile proprii
  •