This is related to Add Google Doc button into custom 'notes and attachments' Visualforce component but using 100% native SFDC, no jQuery.
- Google Docs enabled
Simple VF page using only apex:detail
<apex:page standardController="Bar__c"> <apex:detail inlineEdit="true" relatedList="true"/> </apex:page>
When you click New Document, the Google dialog appears as expected:
Yet you go one step further and click 'Create Google Doc', SFDC redirects you to the home page!
But, if you eliminate the VF page altogether and use the standard page layout, the sequence works as expected and you are redirected after authentication to a Google Docs page where your 'Foo' document is saved and can be edited.
HTTP traffic - failure use case [VF page] (some lines omitted for irrelevance, url string decoded for readability)
- VF requests page: GET /_ui/core/google/docs/GoogleDocAuthenticate/d?denied=/_ui/core/google/docs/GoogleDocDenied/d&next=/_ui/core/google/docs/GoogleDocSuccess/d?method=0&docName=foo%&parentId=a1uK0000001SfoS&docType=DOCUMENT&secret=24900737
- Response is redirect to salesforce.com domain: https://cs9.salesforce.com/_ui/core/google/docs/GoogleDocAuthenticate/d?denied=/_ui/core/google/docs/GoogleDocDenied/d&next=/_ui/core/google/docs/GoogleDocSuccess/d?method=0&docName=foo&parentId=a1uK0000001SfoS&docType=DOCUMENT&secret=24900737
- salesforce.com requests page: GET /?parentId=a1uK0000001SfoS&docName=foo2&docType=DOCUMENT&next=/_ui/core/google/docs/GoogleDocSuccess/d?method=0&docName=foo&parentId=a1uK0000001SfoS&docType=DOCUMENT&secret=24900737&denied=/_ui/core/google/docs/GoogleDocDenied/d&secret=24900737&method=0&retry=1
- Response is redirect back to itself: https://cs9.salesforce.com/?parentId=a1uK0000001SfoS&docName=foo&docType=DOCUMENT&next=/_ui/core/google/docs/GoogleDocSuccess/d?method=0&docName=foo&parentId=a1uK0000001SfoS&docType=DOCUMENT&secret=24900737&denied=/_ui/core/google/docs/GoogleDocDenied/d&secret=24900737&method=0&retry=1
- salesforce.com requests page: GET /?parentId=a1uK0000001SfoS&docName=foo&docType=DOCUMENT&next=/_ui/core/google/docs/GoogleDocSuccess/d?method=0&docName=foo&parentId=a1uK0000001SfoS&docType=DOCUMENT&secret=24900737&denied=/_ui/core/google/docs/GoogleDocDenied/d&secret=24900737&method=0&retry=1
- Response is redirect to home page: https://cs9.salesforce.com/home/home.jsp?sdtd=1
HTTP traffic - success use case [std layout] (some lines omitted for irrelevance)
GET 200 text/html https://cs9.salesforce.com/_ui/core/google/docs/GoogleDocAuthenticate/d?denied=/_ui/core/google/docs/GoogleDocDenied/d&next=/_ui/core/google/docs/GoogleDocSuccess/d?method=0&docName=foo&parentId=a1uK0000001SfoS&docType=DOCUMENT&secret=8569450
GET 302 Redirect to: https://www.google.com/accounts/ServiceLogin?service=wise&passive=1209600&continue=https://docs.google.com/a/ourdomain.com/document/d/1Ck4ZNYwQLf34opHJUhv1aFB8LdQmiVyvwGlaCeeO2SI/edit?usp=docslist_api&followup=https://docs.google.com/a/ourdomain.com/document/d/1Ck4ZNYwQLf34opHJUhv1aFB8LdQmiVyvwGlaCeeO2SI/edit?usp=docslist_api&authuser=1
This is very bizarre, if I start on a VF page, VF redirects to the salesforce.com domain but then this page /_ui/core/google/docs/GoogleDocAuthenticate/d
never loads, yet if I start on the standard layout, salesforce.com happily and successfully requests page /_ui/core/google/docs/GoogleDocAuthenticate/d
which loads and does its thing.
UPDATE 2014-04-17 - SFDC Developer Support has marked as Known Issue - although the wording of the issue isn't very precise