0

I'm currently working on a Gadget which displays comments, via google docs spreadsheet, on my Google Site. I want the Gagdet to automaticly fetch the Username of the currently logged in User and parse it automaticly in the field "Name:" of the Gadget. I've tried with JavaScript to get the name with the span id, but JavaScript doesn't allow you to acces an external iFrame from another domain. My question is, is there any possibility to get informations about the logged in user? Maybe with the Google API or any other ways with JavaScript.

Matt Cain
  • 5,638
  • 3
  • 36
  • 45
  • possible duplicate of [Google Authentication API: How to get the user's gmail address](http://stackoverflow.com/questions/83476/google-authentication-api-how-to-get-the-users-gmail-address) – jbabey Mar 06 '13 at 15:35

1 Answers1

0

As you said, this is not possible, getting contents if Iframe from outside is permission denied. But there are some APIs from google that will let you see some information from logged in user. But you need to have permission:

GET https://www.googleapis.com/plus/v1/people/{userId}

or

https://www.googleapis.com/plus/v1/activities/z12gtjhq3qn2xxl2o224exwiqruvtda0i?key=YOUR-API-KEY

For more information have a look at https://developers.google.com/+/api/

Mostafa Shahverdy
  • 2,687
  • 2
  • 30
  • 51