1

I need to access to my Web App using HTTP GET and POST requests in my console application, but unfortunately I can't use anonymous access option in "Who has access to the web app". Is there any chance to do it using any approaches (OAuth2 client Id, service account, even my login and password....) ?

ziganotschka
  • 25,866
  • 2
  • 16
  • 33
no_
  • 11
  • 1

2 Answers2

1

yes this is possible as of a few days ago. look at apps script execution api. the code will run under the passed user's token and will consume their quotas (not the developer or owner):

http://googleappsdeveloper.blogspot.com/2015/09/run-apps-script-code-from-anywhere.html

Zig Mandel
  • 19,571
  • 5
  • 26
  • 36
  • Looks like great but in this case I have to interact with a program (e.g. I have to click on a button on a oauth page that appears in a browser). Is there any option to make my script fully automatic ? – no_ Sep 28 '15 at 01:21
  • yes becsuse in my answer its you who pass the oauth access token. so get it first and call a function that does all you need ui-less – Zig Mandel Sep 28 '15 at 01:24
  • I have tried a python quickstart from a link on that page, and that example opens my browser with standard ouath confirmation page. If I try to replace OAuth client id credentials with Service account credentials I have 404 'Requested entity was not found' response – no_ Sep 28 '15 at 01:34
0

Welcome to Stack Overflow.

Not 100% sure it's what your looking for, but to run a script via calling it over the web you DO need an OAuth 2 token, they accept any of the many OAuth providers google makes. See more information on running scripts via http post here and info on google oauth providers here.

If you provide more information on what the client is going to be that calls your google app, i.e. javascript, C#, etc and also what you will be doing, i.e. calling a custom http listener in your app or a google endpoint like the above mentioned.

Michael Crook
  • 1,520
  • 2
  • 14
  • 37
  • not true if published to be accessed as anonymous there is no need to authorize. – Zig Mandel Sep 27 '15 at 20:45
  • Client is a small python automation script for printing data sent via POST to a spreadsheet. So would be great to have approach that doesn't need any interaction like a clicking on a button in a browser – no_ Sep 28 '15 at 01:25