TMS FMX Cloud GMail authentication data

Hi,


I have been trying to use TMS FMX Cloud Gmail component. I created
a Gmail AppKey and AppSecret and plugged those into the demo Gmail project you
provide. I then built this for iOS and at first (for a short period) all seemed
well. However, now when I use the app, I have to sign into Gmail as part for
the authentication and click send which appears to work, but the email never
arrives at the recipient, and when I look in my actual Gmail outbox, the email
is there, but marked as ?This email may not have been sent my [my correct email
address]? which is something to do with authentication not being present in the
email. I assume the missing authentication data in the email is why it does not
get through the recipient.

Any idea what could be going wrong?

<o:p></o:p>

Hi,


We are not aware of such an issue with the TTMSFMXCloudGMail component.

Does the same issue occur when running the application on Windows?
Can you please provide a LOG file so I can further investigate this?
Logging can be enabled by setting Logging to True and LogLevel to llDetail. The LOG file is automatically generated in the machine's Documents folder.

I have added a little to the project to grab the log file in iOS. I've tried to mask keys etc in this email. If you need the log files, please let me know and I'll email them to you.


The application builds and runs fine in Windows, and the top of the log file says this:

20171031T161145:HTTPS GET RESULT:{
 "emailAddress": "[HIDDEN PART HERE]@gmail.com",
 "messagesTotal": 88,
 "threadsTotal": 79,
 "historyId": "28359"
}

I still get the same problem is iOS (I simply rebuilt and run on iOS) :
20171031T161047:HTTPS GET RESULT:{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "authError",
    "message": "Invalid Credentials",
    "locationType": "header",
    "location": "Authorization"
   }
  ],
  "code": 401,
  "message": "Invalid Credentials"
 }
}

20171031T161235:HTTPS POST: accounts.google.com/o/oauth2/token
20171031T161235:HTTPS POST RES:200
20171031T161235:HTTPS POST RESULT:{
  "access_token" : "ya29.Glv1BPQPXhEE1ePMitXM-otRN68HD[HIDDEN PART HERE]VLhZGVz-uaDG7MsdRD1nHKDpYq3IchWRHDAQ09MOXQ1ift6zg8Jh9f",
  "expires_in" : 3600,
  "id_token" : "eyJhbGciOiJSUzI1NiIsImtpZCI6IjRkMGY[HIDDEN PART HERE]YmUxNjMzOTEifQ.eyJhenAiOiIxMzQ2MjE5OTM5ODQtcDY3YWQwaG1wdXVldX[HIDDEN PART HERE]wcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJhdWQiOiIxMzQ2MjE5OTM5ODQtcDY3YWQwaG1wdXVldXUxdmllOTN0a3RuaTZvNjBmMGwuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJzdWIiOiIxMTgwNTc4MDk5ODg3NTAxMTgzMDMiLCJlbWFpbCI6InZwLnBhdWwuc21pdGhAZ21haWwuY29tIiwiZW1haWxfdmVyaWZpZWQiOnRydWUsImF0X2hhc2giOiJpRWVGYW1oQjNuZ1o2QVQyUGRIeDZBIiwiaXNzIjoiYWNjb3VudHMuZ29vZ2xlLmNvbSIsImlhdCI6MTUwOTQ2NjM1NSwiZXhwIjoxNTA5NDY5OTU1fQ.jcPKMTArdyHiXjyI1NBbo66a9EJIGitkjglbPF_2JggiJtRzLKy38CypiTAr43tBpEBG80IXWjJYBg9Q-QjeIYfcZ__6znrB3wfk_SDTvDm3GXsO_VgBlvwdB85EcigDOT3v9xvcGGd1eyemKADLkQzZZub_ERt9ZT1NkGn18y_hdb6R6NzvLbNpS_OiWSP04tMZh_uBFnpwTKU34k-is8uw5UQxEcu7fAiC2I-TOiDb2uFydAMJ_kDNHT9VXmZJC_jhIlLwSMXlxyTm_eoIzqBCvw-Q43wBfV5sC3vugo7gNO2Lrqxw9dOojLgw4MocImrGxVvOIW_Egi8ZZ3FbrQ",
  "refresh_token" : "1/GxwLvMECOe3U7QqEPzay[HIDDEN PART HERE]nYG-siKdOkM5NwxFxvC",
  "token_type" : "Bearer"
}

From this description, it would appear that on iOS there is no valid access token. The log shows no valid access token was found and then it should go through a new authentication / authorization cycle which is what the second part of the log shows. After this, it should be possible to get the email account info though, but there is no further log.
Please show the log of what happens AFTER this access token was successfully obtained.

Thanks for your help on this.


The whole iOS log file is:

20171031T161047:HTTPS GET RESULT:{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "authError",
    "message": "Invalid Credentials",
    "locationType": "header",
    "location": "Authorization"
   }
  ],
  "code": 401,
  "message": "Invalid Credentials"
 }
}

20171031T161235:HTTPS POST: accounts.google.com/o/oauth2/token
20171031T161235:HTTPS POST RES:200
20171031T161235:HTTPS POST RESULT:{
  "access_token" : "ya29.Glv1BPQPXhEE1ePMitXM-otRN68HD[HIDDEN PART HERE]VLhZGVz-uaDG7MsdRD1nHKDpYq3IchWRHDAQ09MOXQ1ift6zg8Jh9f",
  "expires_in" : 3600,
  "id_token" : "eyJhbGciOiJSUzI1NiIsImtpZCI6IjRkMGY[HIDDEN PART HERE]YmUxNjMzOTEifQ.eyJhenAiOiIxMzQ2MjE5OTM5ODQtcDY3YWQwaG1wdXVldX[HIDDEN PART HERE]wcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJhdWQiOiIxMzQ2MjE5OTM5ODQtcDY3YWQwaG1wdXVldXUxdmllOTN0a3RuaTZvNjBmMGwuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJzdWIiOiIxMTgwNTc4MDk5ODg3NTAxMTgzMDMiLCJlbWFpbCI6InZwLnBhdWwuc21pdGhAZ21haWwuY29tIiwiZW1haWxfdmVyaWZpZWQiOnRydWUsImF0X2hhc2giOiJpRWVGYW1oQjNuZ1o2QVQyUGRIeDZBIiwiaXNzIjoiYWNjb3VudHMuZ29vZ2xlLmNvbSIsImlhdCI6MTUwOTQ2NjM1NSwiZXhwIjoxNTA5NDY5OTU1fQ.jcPKMTArdyHiXjyI1NBbo66a9EJIGitkjglbPF_2JggiJtRzLKy38CypiTAr43tBpEBG80IXWjJYBg9Q-QjeIYfcZ__6znrB3wfk_SDTvDm3GXsO_VgBlvwdB85EcigDOT3v9xvcGGd1eyemKADLkQzZZub_ERt9ZT1NkGn18y_hdb6R6NzvLbNpS_OiWSP04tMZh_uBFnpwTKU34k-is8uw5UQxEcu7fAiC2I-TOiDb2uFydAMJ_kDNHT9VXmZJC_jhIlLwSMXlxyTm_eoIzqBCvw-Q43wBfV5sC3vugo7gNO2Lrqxw9dOojLgw4MocImrGxVvOIW_Egi8ZZ3FbrQ",
  "refresh_token" : "1/GxwLvMECOe3U7QqEPzay[HIDDEN PART HERE]nYG-siKdOkM5NwxFxvC",
  "token_type" : "Bearer"
}
20171031T161235:HTTPS GET RESULT:{
 "labels": [
  {
   "id": "CATEGORY_PERSONAL",
   "name": "CATEGORY_PERSONAL",
   "messageListVisibility": "hide",
   "labelListVisibility": "labelHide",
   "type": "system"
  },
  {
   "id": "CATEGORY_SOCIAL",
   "name": "CATEGORY_SOCIAL",
   "messageListVisibility": "hide",
   "labelListVisibility": "labelHide",
   "type": "system"
  },
  {
   "id": "CATEGORY_UPDATES",
   "name": "CATEGORY_UPDATES",
   "messageListVisibility": "hide",
   "labelListVisibility": "labelHide",
   "type": "system"
  },
  {
   "id": "CATEGORY_FORUMS",
   "name": "CATEGORY_FORUMS",
   "messageListVisibility": "hide",
   "labelListVisibility": "labelHide",
   "type": "system"
  },
  {
   "id": "CHAT",
   "name": "CHAT",
   "messageListVisibility": "hide",
   "labelListVisibility": "labelHide",
   "type": "system"
  },
  {
   "id": "SENT",
   "name": "SENT",
   "type": "system"
  },
  {
   "id": "INBOX",
   "name": "INBOX",
   "type": "system"
  },
  {
   "id": "TRASH",
   "name": "TRASH",
   "messageListVisibility": "hide",
   "labelListVisibility": "labelHide",
   "type": "system"
  },
  {
   "id": "CATEGORY_PROMOTIONS",
   "name": "CATEGORY_PROMOTIONS",
   "messageListVisibility": "hide",
   "labelListVisibility": "labelHide",
   "type": "system"
  },
  {
   "id": "DRAFT",
   "name": "DRAFT",
   "type": "system"
  },
  {
   "id": "SPAM",
   "name": "SPAM",
   "messageListVisibility": "hide",
   "labelListVisibility": "labelHide",
   "type": "system"
  },
  {
   "id": "STARRED",
   "name": "STARRED",
   "type": "system"
  },
  {
   "id": "UNREAD",
   "name": "UNREAD",
   "type": "system"
  },
  {
   "id": "IMPORTANT",
   "name": "IMPORTANT",
   "messageListVisibility": "hide",
   "labelListVisibility": "labelHide",
   "type": "system"
  },
  {
   "id": "Label_1",
   "name": "Unwanted",
   "type": "user"
  }
 ]
}

20171031T161235:HTTPS GET: https://www.googleapis.com/oauth2/v1/userinfo?access_token=ya29.Glv1BPQPXhEE1ePMitXM-[HIDDEN PART HERE]Vne0CJ0x_tmI6VVLhZGVz-uaDG7MsdRD1nHKDpYq3IchWRHDAQ09MOXQ1ift6zg8Jh9f
20171031T161235:HTTPS GET RESULT:{
 "id": "118057809988750118303",
 "email": "[HIDDEN PART HERE]@gmail.com",
 "verified_email": true,
 "name": "Pau Smith",
 "given_name": "Pau",
 "family_name": "Smith",
 "locale": "en-GB"
}


According to this log, it is able to get mails from the gmail service, so, this means the access token successfully works. 
I don't see anything in the log file corresponding to sending emails though.

I'm not sure I understand. Below is the complete log from Windows 10 which did successfully send an email. After the initial authentication there are 2 sections? These are very similar to the iOS log, but the two sections are logged in a different order.

I know iOS did attempt to send an email because if I look in my gmail account on another PC, it shows the email in the outbox with the message about no authentication data included.
I'm not sure what else to try or investigate?

20171031T161145:HTTPS GET RESULT:{
 "emailAddress": "[HIDDEN PART HERE]@gmail.com",
 "messagesTotal": 88,
 "threadsTotal": 79,
 "historyId": "28359"
}

20171031T161145:HTTPS GET: https://www.googleapis.com/oauth2/v1/userinfo?access_token=ya29.Glv1BKQgShbRZ2JO3zJ2R[HIDDEN PART HERE]AR1adm9Rik6P2EEzR9ymgWL8SheecXAECoyKxduXF5kPp5e85uic2RowmAC6gJsRnAYw
20171031T161145:HTTPS GET RESULT:{
 "id": "118057809988750118303",
 "email": "[HIDDEN PART HERE]@gmail.com",
 "verified_email": true,
 "name": "Pau Smith",
 "given_name": "Pau",
 "family_name": "Smith",
 "locale": "en-GB"
}

20171031T161145:HTTPS GET RESULT:{
 "labels": [
  {
   "id": "CATEGORY_PERSONAL",
   "name": "CATEGORY_PERSONAL",
   "messageListVisibility": "hide",
   "labelListVisibility": "labelHide",
   "type": "system"
  },
  {
   "id": "CATEGORY_SOCIAL",
   "name": "CATEGORY_SOCIAL",
   "messageListVisibility": "hide",
   "labelListVisibility": "labelHide",
   "type": "system"
  },
  {
   "id": "CATEGORY_UPDATES",
   "name": "CATEGORY_UPDATES",
   "messageListVisibility": "hide",
   "labelListVisibility": "labelHide",
   "type": "system"
  },
  {
   "id": "CATEGORY_FORUMS",
   "name": "CATEGORY_FORUMS",
   "messageListVisibility": "hide",
   "labelListVisibility": "labelHide",
   "type": "system"
  },
  {
   "id": "CHAT",
   "name": "CHAT",
   "messageListVisibility": "hide",
   "labelListVisibility": "labelHide",
   "type": "system"
  },
  {
   "id": "SENT",
   "name": "SENT",
   "type": "system"
  },
  {
   "id": "INBOX",
   "name": "INBOX",
   "type": "system"
  },
  {
   "id": "TRASH",
   "name": "TRASH",
   "messageListVisibility": "hide",
   "labelListVisibility": "labelHide",
   "type": "system"
  },
  {
   "id": "CATEGORY_PROMOTIONS",
   "name": "CATEGORY_PROMOTIONS",
   "messageListVisibility": "hide",
   "labelListVisibility": "labelHide",
   "type": "system"
  },
  {
   "id": "DRAFT",
   "name": "DRAFT",
   "type": "system"
  },
  {
   "id": "SPAM",
   "name": "SPAM",
   "messageListVisibility": "hide",
   "labelListVisibility": "labelHide",
   "type": "system"
  },
  {
   "id": "STARRED",
   "name": "STARRED",
   "type": "system"
  },
  {
   "id": "UNREAD",
   "name": "UNREAD",
   "type": "system"
  },
  {
   "id": "IMPORTANT",
   "name": "IMPORTANT",
   "messageListVisibility": "hide",
   "labelListVisibility": "labelHide",
   "type": "system"
  },
  {
   "id": "Label_1",
   "name": "Unwanted",
   "type": "user"
  }
 ]
}