AppScript UrlFetchApp.fetch() not working for WebApp accessible only by domain users The Next CEO of Stack OverflowHow to use UrlFetchApp with credentials? Google ScriptsFailure in Fetching Google Script's URLFetch JSON object from Google WebApp from another Google WebAppTransferring data to GAS via doPost does'nt workBounded appscript to google sheet is not working after being shared with java drive SDK v3Google Suite App Script Email Sending LimitRemote request and oauth for Google Apps Script webappG Suite Emails Sent with Google Apps Script Are Not Delivered “Message Blocked”Gmailapp sendemail select different accountPost from Infusionsoft to spreadsheet. Google WebApp permission settings

Why did early computer designers eschew integers?

Can a PhD from a non-TU9 German university become a professor in a TU9 university?

Is it okay to majorly distort historical facts while writing a fiction story?

My boss doesn't want me to have a side project

Is it "common practice in Fourier transform spectroscopy to multiply the measured interferogram by an apodizing function"? If so, why?

Car headlights in a world without electricity

Does int main() need a declaration on C++?

Is a linearly independent set whose span is dense a Schauder basis?

Strange use of "whether ... than ..." in official text

Was the Stack Exchange "Happy April Fools" page fitting with the 90s code?

Find the majority element, which appears more than half the time

Is there a rule of thumb for determining the amount one should accept for a settlement offer?

What difference does it make matching a word with/without a trailing whitespace?

MT "will strike" & LXX "will watch carefully" (Gen 3:15)?

Man transported from Alternate World into ours by a Neutrino Detector

Does the Idaho Potato Commission associate potato skins with healthy eating?

Could you use a laser beam as a modulated carrier wave for radio signal?

Incomplete cube

How dangerous is XSS

How to compactly explain secondary and tertiary characters without resorting to stereotypes?

A hang glider, sudden unexpected lift to 25,000 feet altitude, what could do this?

Why does the freezing point matter when picking cooler ice packs?

Calculate the Mean mean of two numbers

Compensation for working overtime on Saturdays



AppScript UrlFetchApp.fetch() not working for WebApp accessible only by domain users



The Next CEO of Stack OverflowHow to use UrlFetchApp with credentials? Google ScriptsFailure in Fetching Google Script's URLFetch JSON object from Google WebApp from another Google WebAppTransferring data to GAS via doPost does'nt workBounded appscript to google sheet is not working after being shared with java drive SDK v3Google Suite App Script Email Sending LimitRemote request and oauth for Google Apps Script webappG Suite Emails Sent with Google Apps Script Are Not Delivered “Message Blocked”Gmailapp sendemail select different accountPost from Infusionsoft to spreadsheet. Google WebApp permission settings










0















I currently have an issue where I have:



  • Main account who owns an appscript deployed as a WebApp with excute set to "Me"
    and acces set to "Anyone within @[mydomain].com" with doGet() and doPost()
    methods.


  • Secondary account who ownsappscript sending UrlFetchApp.fetch("mainAppURL").


Running the script in the secondary account returns the HTML of the Google Sign Page with response.getContentText() and does not run the doGet() method, but running the mainAppURL in the address bar seems to work.



Why is the script not creating a pop up to request the user to sign in?










share|improve this question
























  • Is the secondary account within your domain?

    – TheMaster
    Mar 8 at 21:02











  • Yes it is within the same domain! Currently trying to generate an oAuth token with the secondary user and passing the token within the header but getting a "401 unauthorized exception"

    – Daniel
    Mar 8 at 21:20











  • OMG THIS WAS IT !!!! I just ran A DriveApp function to enable the scope and it worked! Thank you!

    – Daniel
    Mar 8 at 21:28











  • @TheMaster You can repost my answer so that I can mark as solved, Thank you

    – Daniel
    Mar 8 at 21:38











  • Great! Your answer is enough. You can mark it as solved yourself.

    – TheMaster
    Mar 8 at 21:55















0















I currently have an issue where I have:



  • Main account who owns an appscript deployed as a WebApp with excute set to "Me"
    and acces set to "Anyone within @[mydomain].com" with doGet() and doPost()
    methods.


  • Secondary account who ownsappscript sending UrlFetchApp.fetch("mainAppURL").


Running the script in the secondary account returns the HTML of the Google Sign Page with response.getContentText() and does not run the doGet() method, but running the mainAppURL in the address bar seems to work.



Why is the script not creating a pop up to request the user to sign in?










share|improve this question
























  • Is the secondary account within your domain?

    – TheMaster
    Mar 8 at 21:02











  • Yes it is within the same domain! Currently trying to generate an oAuth token with the secondary user and passing the token within the header but getting a "401 unauthorized exception"

    – Daniel
    Mar 8 at 21:20











  • OMG THIS WAS IT !!!! I just ran A DriveApp function to enable the scope and it worked! Thank you!

    – Daniel
    Mar 8 at 21:28











  • @TheMaster You can repost my answer so that I can mark as solved, Thank you

    – Daniel
    Mar 8 at 21:38











  • Great! Your answer is enough. You can mark it as solved yourself.

    – TheMaster
    Mar 8 at 21:55













0












0








0








I currently have an issue where I have:



  • Main account who owns an appscript deployed as a WebApp with excute set to "Me"
    and acces set to "Anyone within @[mydomain].com" with doGet() and doPost()
    methods.


  • Secondary account who ownsappscript sending UrlFetchApp.fetch("mainAppURL").


Running the script in the secondary account returns the HTML of the Google Sign Page with response.getContentText() and does not run the doGet() method, but running the mainAppURL in the address bar seems to work.



Why is the script not creating a pop up to request the user to sign in?










share|improve this question
















I currently have an issue where I have:



  • Main account who owns an appscript deployed as a WebApp with excute set to "Me"
    and acces set to "Anyone within @[mydomain].com" with doGet() and doPost()
    methods.


  • Secondary account who ownsappscript sending UrlFetchApp.fetch("mainAppURL").


Running the script in the secondary account returns the HTML of the Google Sign Page with response.getContentText() and does not run the doGet() method, but running the mainAppURL in the address bar seems to work.



Why is the script not creating a pop up to request the user to sign in?







google-apps-script web-applications google-oauth gsuite urlfetch






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 8 at 21:02









TheMaster

10.6k3936




10.6k3936










asked Mar 8 at 19:33









DanielDaniel

112




112












  • Is the secondary account within your domain?

    – TheMaster
    Mar 8 at 21:02











  • Yes it is within the same domain! Currently trying to generate an oAuth token with the secondary user and passing the token within the header but getting a "401 unauthorized exception"

    – Daniel
    Mar 8 at 21:20











  • OMG THIS WAS IT !!!! I just ran A DriveApp function to enable the scope and it worked! Thank you!

    – Daniel
    Mar 8 at 21:28











  • @TheMaster You can repost my answer so that I can mark as solved, Thank you

    – Daniel
    Mar 8 at 21:38











  • Great! Your answer is enough. You can mark it as solved yourself.

    – TheMaster
    Mar 8 at 21:55

















  • Is the secondary account within your domain?

    – TheMaster
    Mar 8 at 21:02











  • Yes it is within the same domain! Currently trying to generate an oAuth token with the secondary user and passing the token within the header but getting a "401 unauthorized exception"

    – Daniel
    Mar 8 at 21:20











  • OMG THIS WAS IT !!!! I just ran A DriveApp function to enable the scope and it worked! Thank you!

    – Daniel
    Mar 8 at 21:28











  • @TheMaster You can repost my answer so that I can mark as solved, Thank you

    – Daniel
    Mar 8 at 21:38











  • Great! Your answer is enough. You can mark it as solved yourself.

    – TheMaster
    Mar 8 at 21:55
















Is the secondary account within your domain?

– TheMaster
Mar 8 at 21:02





Is the secondary account within your domain?

– TheMaster
Mar 8 at 21:02













Yes it is within the same domain! Currently trying to generate an oAuth token with the secondary user and passing the token within the header but getting a "401 unauthorized exception"

– Daniel
Mar 8 at 21:20





Yes it is within the same domain! Currently trying to generate an oAuth token with the secondary user and passing the token within the header but getting a "401 unauthorized exception"

– Daniel
Mar 8 at 21:20













OMG THIS WAS IT !!!! I just ran A DriveApp function to enable the scope and it worked! Thank you!

– Daniel
Mar 8 at 21:28





OMG THIS WAS IT !!!! I just ran A DriveApp function to enable the scope and it worked! Thank you!

– Daniel
Mar 8 at 21:28













@TheMaster You can repost my answer so that I can mark as solved, Thank you

– Daniel
Mar 8 at 21:38





@TheMaster You can repost my answer so that I can mark as solved, Thank you

– Daniel
Mar 8 at 21:38













Great! Your answer is enough. You can mark it as solved yourself.

– TheMaster
Mar 8 at 21:55





Great! Your answer is enough. You can mark it as solved yourself.

– TheMaster
Mar 8 at 21:55












1 Answer
1






active

oldest

votes


















0














As @TheMaster said, the driveApp scope should be in the project properties (running a driveApp command will run the authorization) so that a script from a secondary account within the domain may perform a fetch request to as script owned by another account within that same domain.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55069849%2fappscript-urlfetchapp-fetch-not-working-for-webapp-accessible-only-by-domain-u%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    As @TheMaster said, the driveApp scope should be in the project properties (running a driveApp command will run the authorization) so that a script from a secondary account within the domain may perform a fetch request to as script owned by another account within that same domain.






    share|improve this answer



























      0














      As @TheMaster said, the driveApp scope should be in the project properties (running a driveApp command will run the authorization) so that a script from a secondary account within the domain may perform a fetch request to as script owned by another account within that same domain.






      share|improve this answer

























        0












        0








        0







        As @TheMaster said, the driveApp scope should be in the project properties (running a driveApp command will run the authorization) so that a script from a secondary account within the domain may perform a fetch request to as script owned by another account within that same domain.






        share|improve this answer













        As @TheMaster said, the driveApp scope should be in the project properties (running a driveApp command will run the authorization) so that a script from a secondary account within the domain may perform a fetch request to as script owned by another account within that same domain.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 8 at 21:36









        DanielDaniel

        112




        112





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55069849%2fappscript-urlfetchapp-fetch-not-working-for-webapp-accessible-only-by-domain-u%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

            2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

            Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme