I have had a look at some of the oAuth2 documentation and a few of the Developer videos. Tried to follow some examples but failed - never tried anything but VBA before.
My question is will this be possible?
What I would like to do is log out a user after they accept my app and log back in as a specific user in our domain for them to download a Chrome extension.
User accepts setup for uploading to database
App logs out user and logs in DB-Account
Relevant URL is opened in Chrome
Save to Google Drive extension is downloaded by user
Setup complete - yes, will sign out the DB-Account from Chrome
Related
edit: I have created a bug with Google for this issue https://issuetracker.google.com/issues/210205631
This is a summary of the situation:
Topic
Comment
Issue
Not being able to access /dev of a project. Browser console shows 404 Not Found
Worked before?
Worked for months
Caused by a user-initiated change?
To my knowledge, there was no change to the code nor settings of the project. There is no other accessing the code of the project. Not sure if some change happened to the spreadsheet
Project location
The project's container is a spreadsheet
Project type
GCP default
Deployed
Execute as me + Who has access anyone
Permission
I am not the owner of the spreadsheet. I am able to edit and share the spreadsheet. The owner holds #gmail.com type of account. The owner is not able to access /dev either
Script role
My role in the script setting is an editor
New deployments
I am able to create new deployments. New and existing deployments can be access by their URLs. But /dev
Multiple accounts
I am NOT logged into multiple accounts
Browsers
Tested on latest versions f 5 major browsers
Copy script
When I make a copy of the script, I get the same result as above
Tested on
The above applies to my google.com and my legacy free GSuite account. Tested also in incognito mode. Tested by logging into google account that got edit access to the spreadsheet then script editor was opened from the spreadsheet and /dev access from the editor
Copy spreadsheet
When I make a copy of the original spreadsheet I am able to access /dev
I have a web GAS project that was working in production for months. Now there was reported an error by a user of the actual application. I went to investigate it and wanted to open test deployment but received
"Sorry, unable to open the file at present."
Details
The project is bound to a Google Spreadsheet. I am not the owner of the Google Spreadsheet that GAS code is attached to. I never was.
Troubleshooting steps I've taken:
I tested the issue on Firefox, Edge, Vivaldi, and Chrome. The latest version of the browsers and restarted my computer. I was able to reproduce the issue on both Gmail account and legacy GSuite account. I am not logged into multiple Google accounts. Gmail account returns this dev URL: https://script.google.com/macros/s/<deploymentId>/dev. GSuite account returns this dev URL: https://script.google.com/a/macros/<domain>/s/<deploymentId>/dev
I created a copy of the Google Script and modify it so it can access the original spreadsheet. When deploying I got this error message
"Only users in the same domain as the script may deploy this script."
I am not the owner of the new script. My role is editor. I am not able to deploy under my GSuite account. The owner is on Gmail. I am able to create new deployment under my Gmail account, but I am not able to access test environment:
The script owner has the same /dev URL as I do and is getting the same error.
The question is self sufficient, but I made short video to show that /dev(test environment) end point is not accessible and throws this error, but versioned deployment(/exec) is accessible.
I was able to find steps how to reproduce this issue and created a bug report with Google https://issuetracker.google.com/issues/210205631
Steps to reproduce:
create new standard project and deploy as web app
access /dev - it works
share the project with account xyz
open the project under xyz and access /dev. it works
modify the project under xyz accocunt and access /dev. it does NOT work. You get "Sorry, unable to open the file at present" error.
open the script as owner and access /dev. it does not work
save the project as owner and access /dev. it works
repeat from point 4)
I have created a gmail addon and deployed a version of it to our domain marketplace. After first screen i am not able to navigate to my next screen. I think there are some permissions which i need to enable.
I am using admin directory api in my application. i have enabled admin sdk access to my app from console.
How can i find logs for the app that is deployed to marketplace?
You can enclose your Apps Script code in try/catch blocks and use the console API to log errors and warnings.
Then visit the StackDriver Logging dashboard associated with your project to view information logged into the console.
To view the logs, open the Script Editor, go to View > StackDriver.
I'm trying to get the Cyberduck CLI (duck.sh) to work interfacing with a google drive (not "Google Cloud Storage") and I'm having problems getting the oAuth authorization to work. I found this thread but it's out of date - as the newer versions of Cyberduck do absolutely work with Google Drive. Using the regular cyberduck GUI I can browse and operate on my G-drive instance, but I can't quite quack the code (sorry!) for how to make this work using the CLI.
[lwobker:~]$ duck -l googledrive://<user>#gmail.com/
Authenticating as <user>…
OAuth2 Authentication. Paste the authentication code from your web browser.
Authentication Code: <pasted pass here>
Save password (y/n): n
Disconnecting www.googleapis.com…
Login failed. Malformed auth code. Please contact your web hosting service provider for assistance.
I've tried a number of different URLs, including:
#gmail.com
me#gmail.com#www.googleapis.com
and a couple of others.
I also can't seem to figure out where the GUI version of cyberduck stores it's authorized credentials... if I could re-use those that would be fine, doing a one-time setup at the beginning doesn't break my use case.
I'm somewhat familiar with the Google Developers API, and I've created one for use with this project, but I can't seem to figure out how the Google "Client ID" and other credentials map to the Cyberduck tool.
Make sure you paste the auth code obtained from the Google login page opened exactly as is without any line breaks. More information is available in the wiki.
I'm trying to make a service that runs on a webserver and can upload files to Google Drive,
so that people can sync the files to local-drive using the Google desktop application.
So I tried the Drive API but it requires a webbrowser to authenticate.
This would be a possibility, but I don't know to get the access token programmically.
Even if I had the access token, I wouldn't know if it just works forever.. It seems to have an expire date?
I wouldn't want the service to suddenly not working, because the token has expired.
Than I learned about Service Account, and finally got it working, but it seems to have its own space that i can only access with the service account.
I don't know how to share the files from the service account to a regular account, as people need to sync it locally.
So a found a video about user impersonation, in which he showed a page about given access to a service account to impersonate another user.
But i don't know where to find this page.
Looking at: http://support.google.com/a/bin/answer.py?hl=en&answer=162106&topic=2759255&ctx=topic
It says it's in Advanced Tools > Manage third party OAuth client access (under the Authentication section).
But where is the Authentication section? Do I need to create a Google App to do this?
The question is: How upload files programmically to Google Drive without any user intervention, so that they can be synced locally with the drive desktop-application.
We have read other posts where it is said that for us to store a file in a google drive, the client must install a web app form the Chrome Store. But the fact is that we do not need a Web App and do not want to have our customers install a "non-app" just to get access to their drives. We have found suggestions to use the Document List API but we do not find it in the API Console as it has been deprecated.
The error we get is:
"googleapi: Error 403: The authenticated user has not installed the app with client id XXXXX"
Please advise.
Thanks
Check this question for the reason behind the installation requirement: Reason for installation through Chrome Web Store.
And stay tuned for announcements very soon!