I am trying to upload a file (pdf) to google docs, going through oauth. However, I get a 403 forbidden response. I wonder if it is at all possible, because the code samples I keep on seeing are those where you pass your username and password. This is not what I want; I do not want to ask for the user to enter his/her credentials.
If it might help, this is the scope that I put in my access code request: "https://docs.google.com/feeds/ https://docs.googleusercontent.com/ https://spreadsheets.google.com/feeds/"
Can anyone shed some light into this?
Thanks.
When using the ResumableUploader component with OAuth to upload files to Drive, you should instantiate either an OAuth2Authenticator or a OAuth3LeggedAuthenticator, according to whether you want to use OAuth 2.0 (recommended) or OAuth 1.0.
The library also includes an example showing how to define the OAuth2Parameters required for the OAuth2Authenticator: http://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/samples/oauth2_sample/oauth2demo.cs
Once you instantiate the authenticator, you can use the sample code for document uploads in the docs: https://developers.google.com/google-apps/documents-list/#uploading_a_new_document_or_file_with_both_metadata_and_content