Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7825109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:50:16+00:00 2026-06-02T08:50:16+00:00

I’m using the google api javascript client to get information about the user profile

  • 0

I’m using the google api javascript client to get information about the user profile inside a gwt project hosted in google app engine.

In localhost, the data is being retrieved correctly. I get a json with the google plus profile. When I deploy to appengine, the response is 401, “@me called by anonymous”.

Here is my Code:

<script src="https://apis.google.com/js/client.js"></script>
<script type="text/javascript">
$(function() {
    auth();
});

var API_KEY = "***************************************";
var CLIENT_ID = "************.apps.googleusercontent.com";

var scopes = 'https://www.googleapis.com/auth/plus.me';

function auth() {
        var config = {
                'client_id' : CLIENT_ID,
                'scope' : scopes,
                'key' : API_KEY,
        };
        gapi.client.load('plus', 'v1', function() {
                        api.client.setApiKey(API_KEY);
                        gapi.auth.authorize(config, function() {
                            var request = gapi.client.plus.people.get({
                                    'userId' : 'me',
                            });
                            request.execute(function(resp) {
                                    console.log(resp);
                            });
                        });
        });
}

</script>

What i tried:

  • call to api.client.setApiKey at the begining.
  • create a new google api access with the google api console

update:

This is the complete response error message:

{
  "error": {
   "code": 401,
   "message": "me called by anonymous",
   "data": [
    {
     "domain": "global",
     "reason": "authError",
     "message": "me called by anonymous",
     "locationType": "header",
     "location": "Authorization"
    }
   ]
  },
  "id": "gapiRpc"
}

There are other messages that may be related:

This is one of them:

Skipping duplicate osapi method definition chili.people.list on transport googleapis; others may exist, but suppressing warnings cb=gapi.loaded1 (línea 119)
Skipping duplicate osapi method definition pos.plusones.list on transport googleapis; others may exist, but suppressing warnings cb=gapi.loaded1 (línea 119)
Skipping duplicate osapi method definition chili.activities.list on transport googleapis; others may exist, but suppressing warnings cb=gapi.loaded1 (línea 119)
Skipping duplicate osapi method definition googleapis.newHttpRequest on transport googleapis; others may exist, but suppressing warnings

this is the other:

Invalid auth token. 1025***** vs 140186****
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T08:50:17+00:00Added an answer on June 2, 2026 at 8:50 am

    I could finally resolve the issue with the following settings or steps:

    1) In the google apis console, I left the Redirect URIs section empty and completed the JavaScript origins section with the url of my site, repeating it with the https protocol:

    JavaScript origins:
    http://example.com
    https://example.com
    

    I put the script that loads the api before the end body tag:

    <script src="https://apis.google.com/js/client.js"></script>
    

    This script comes inside the body, before the api script:

    <script type="text/javascript">
    
    var API_KEY = "***************************************";
    var CLIENT_ID = "************.apps.googleusercontent.com";
    
    var scopes = 'https://www.googleapis.com/auth/plus.me';
    
    function auth() {
        var scopes = 'https://www.googleapis.com/auth/plus.me';
    
        gapi.client.setApiKey(API_KEY);
        window.setTimeout(checkAuth, 1000);
    
        function checkAuth() {
            gapi.auth.authorize({
                client_id : CLIENT_ID,
                scope : scopes,
                immediate : false
            }, handleAuthResult);
        }
    
        function handleAuthResult(authResult) {
            if (authResult) {
                makeApiCall();
            } else {
                checkAuth();
            }
        }
    
        function makeApiCall() {
            gapi.client.load('plus', 'v1', function() {
                var request = gapi.client.plus.people.get({
                    'userId' : 'me'
                });
                request.execute(function(resp) {
                    $("#image").attr("src", resp.image.url);
                });
            });
        }
    
    }
    </script>
    

    Then I call the function auth() when the user clicks to see his picture.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
I'm making a simple page using Google Maps API 3. My first. One marker
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.