How to authenticate deployed Google App Script? - google-apps-script

I'm building Google App Script product, when I deployed GAS project, I only want people in my organization can access to the app. It's ok with the browser when user already login with my organization email. But how I can access deployed URL by Postman or Terminal, Do I need access token or anything else?
Any advice is welcome!
Any advice is welcome!

I would like to suggest to use the OAuth PlayGround using the Google Apps Script deployed projects. You can also check this similar SO post for more solutions regarding your issue.

Related

Google scripts web app permissions for specific service out of organization

I am using google app scripts deployed as web app to transfer sensors information from an Arduino that puts out an http request, to a server(https://www.pushingbox.com/), and on to app scripts.
Until now, my web app was published to anyone with the link and now I can only do that to someone inside the organization. I would like to approve only pushingbox.com to be able to use GET as I did before.
Is there a simple way of doing so?
Thanks

GCP project created by an app authorized by me, but I do not have access to it?

I'm developing some automation/integration between a CRM software and my google account. I am attempting to use the Google Apps Script API so I can remotely execute functions in Google Apps Script through the integration I'm building from within the CRM software.
The only problem is, when attempting to run a function which calls a GAS function through the API, I get the following error:
"Apps Script API has not been used in project project number before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/script.googleapis.com/overview?project=103424032563 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
This would normally be no problem, as I would simply access the GCP portal through the link and enable the GAS API, but when I try to access my project, I don't have access at all, and get the "failed to load data" error.
Further complicating my issue, GCP support will not help because they suspect I am a hacker trying to obtain access to a project that, for all they know, isn't mine.
And because I cannot access this project to authorize the API, I also cannot associate my google script with the same project, as this is a requirement for the Google Apps Script API to function.
I suspect it's the CRM software piece in which I'm developing this integration that is causing this error, (somehow the GCP project is being created by a different user,) but they haven't been all that helpful in determining what's going on.
Have any of you had a similar situation? And, if so, how did you approach solving it?
Further complicating my issue, GCP support will not help because they
suspect I am a hacker trying to obtain access to a project that, for
all they know, isn't mine.
Google Support does not refuse to help. They don't accuse you of being a hacker. Google Support can look at the project and see if you have credentials in the project and if you do they can explain how to authorize yourself. However, Google Support requires a support agreement, which is not free. If you do not have one, then you are not entitled to technical support only billing support. Look up your billing account ID and send a request for billing support. Your billing account will also show you which projects are linked to your billing account.
The issue is that you are trying to access the wrong Project ID. Figure out what is the correct Project ID. If you have the Cloud SDK installed execute this command gcloud projects list and this will tell you which projects your credentials have access to.

How to develop/test a Google Script app that is not verified

Recently Google announced OAuth Client Verification
I don't get it. Before verifying an app with Google, I have to develop one, right? But how do I test it, if I don't have the option to run it for myself as a developer without any verification restriction.
For example, I'm developing an app that uses Drive. I need access to Drive at least for myself. Or am I missing something.
Anybody, please help!

Publish Apps Scripts Web App on the Google Apps Market Place

I have a Google Apps Scripts web app and I would like to publish it on the Google Apps Market Place. I followed this instruction (https://developers.google.com/apps-script/guides/domain-wide-web-app) to properly setup the Apps Market Place SDK but I have some troubles.
To test installation flow I use the button in the setup page of the API, so :
My issue is if a user install the app as I allow personal install
The user validate rights and after he is redirected to the application. There I have an issue because the apps script web app request a "Offline access" in a new pop up.
=> I don't know how to add this scope because I don't find any scope for this need to add in the market place SDK setup.
What I found on stackoverflow is I probably have this message because on scope request by apps script web app there is the approval_prompt parameter set to force.
My question is how to avoid that and allow user to connect to app after validating scope on the apps market place ?
Thank you,
Stéphane
You can follow the List of Best Practices
Before you publish your Google App Marketplace application, please review the following list of best practices. Adhering to these best practices will help your application make it through the Google Apps Marketplace review process smoothly without you needing to make additional changes.
This document explain:
3: Define your scopes properly
All OAuth2.0 scopes must be defined in the Google Developer's Console, in the Scopes section of the Google Apps Marketplace SDK. This is essential in order to achieve one-click or zero-click SSO, as described in the following section.
According to this previous question, in the Admin Conso

Getting Google+ Domain API to work in Google Apps Script

I have read loads of good documentation and example for getting external API's to work in Google Apps Script and also access Google API's with OAuth and have successfully integrated them. I can't however find any help with getting the Google+ Domains API https://developers.google.com/+/domains/ working in GAS.
I understand its a little different as it has the capability to do domain wide delegation of authority (which is what I want).
If anyone can help point me in the right direction that would be great.
Many thanks.
I have created a short sample code for the Google+ Domains API with Apps Script.
Please see the gist below.
https://gist.github.com/soundTricker/7130533
Sorry to say, but it's not possible to edit data on other users in the domain with the "Google+ Domains Service"
It tells you in the second part on the first page:
https://developers.google.com/apps-script/advanced/plus-domains
"This service doesn't support the domain-wide delegation feature in the underlying API. This means that domain admininstrators are not able to run a script on behalf of users in their domain."
This is really sad, it would have been so nice if it was possible! Please G00glez fix this =)