How to retrieve values ​​from the JSON object and authenticate it using the google-plus plugin: 0.1


I am using google-plus:0.1 plugin in a Grails Application to enable login using Google+ ,I have successfully logged in and I am getting JSON object back.

Inside plugin there is a code where they are turning JSON string to JSON object and returning back to me. This is the code inside a plugin:-

public Person getCurrentUserProfile() {
    Person person
    try {
        URL url = new URL("${this.accessToken}")
        def jsonString = JSON.parse(url?.text)
        println "URL : " + url.toString()
        println "JSON : " + jsonString

        person = Person.parseJSONForPerson(jsonString)
    } catch (GooglePlusException e) {
    return person

From here I am getting JSON object back Json string printed in console is:-

JSON : [etag:"RqKWnRU4WW46-6W3rWhLR9iFZQM/eUT2aym4R39YBu_ra8ZlhztXJ6w", organizations:[[startDate:1995, title:Science, primary:false, name:St.Joseph's Convent, endDate:2008, type:school]], image:[isDefault:false, url:], isPlusUser:true, emails:[[value:[email protected], type:account]], kind:plus#person, url:, id:102332421579091283598, verified:false, name:[familyName:Sahu, givenName:Kartiki],, circledByCount:9, gender:female, displayName:Kartiki Sahu, objectType:person]

I am unable to fetch emails from the object which I am getting.

I tried fetching familyName as I got it's value, but for givenName it is showing null and for emails and organisation it is showiing empty list like [].

My code :-

def code = request.getParameter("code")
    String accessToken = accessTokenService.generateAccessToken(code)
    googlePlusService.accessToken = accessToken
    def person = googlePlusService.getCurrentUserProfile()

Please help.

You can get value like this .

      String str="""{
 "kind": "plus#person",
 "etag": "\\"RqKWnRU4WW46-6W3rWhLR9iFZQM/eUT2aym4R39YBu_ra8ZlhztXJ6w\\"",
 "gender": "female",
 "emails": [
   "value": "[email protected]",
   "type": "account"
 "objectType": "person",
 "id": "102332421579091283598",
 "displayName": "Kartiki Sahu",
 "name": {
  "familyName": "Sahu",
  "givenName": "Kartiki"
 "url": "",
 "image": {
  "url": "",
  "isDefault": false
 "organizations": [
   "name": "St.Joseph's Convent",
   "title": "Science",
   "type": "school",
   "startDate": "1995",
   "endDate": "2008",
   "primary": false
 "isPlusUser": true,
 "circledByCount": 9,
 "verified": false,
 "domain": ""
        def jsonString  = new JsonSlurper().parseText(str)
        render jsonString.emails.value

I am getting output as a following list .

['[email protected]']