How to use OAuth2 in Google AppEngine to call an Android Device provisioning API in java“Bad Request” (400) when using XOAUTH2 on Google's SMTP service with service accountjava.security.AccessControlException: access deniedGoogle Oauth2 in GWT and AppEngineHow can impersonate a Domain to Access Google API Admin SDK with Oauth2?Google OAuth 2.0 include_granted_scopes not working for installed appiOS Google Signin Doesn't Work Properly With New ScopesHow do I prevent the user from being asked to grant permissions for a Google Apps Marketplace app that the domain administrator has approvedHow to generate OAuth2.0 Bearer when calling App Engine Endpoints API?Re-gain user authorization after scope change in Google App EngineHow does google sign-in for Android application work?

Short story where a flexible reality hardens to an unchanging one

Ultraproduct of Dividing Lines

Why does the salt in the oceans not sink to the bottom?

I have a domain, static IP address and many devices I'd like to access outside my house. How do I route them?

Chemistry Riddle

Strange LED behavior: Why is there a voltage over the LED with only one wire connected to it?

Found more old paper shares from broken up companies

Is it possible to access the complete command line including pipes in a bash script?

If hash functions append the length, why does length extension attack work?

Giving blur shadow to plot

Does Impedance Matching Imply any Practical RF Transmitter Must Waste >=50% of Energy?

Company requiring me to let them review research from before I was hired

Has Peter Parker ever eaten bugs?

Were the Apollo broadcasts recorded locally on the LM?

Why did NASA use Imperial units?

Why is DC so, so, so Democratic?

Why did modems have speakers?

Dedicated to our #1 Fan

How can I deal with someone that wants to kill something that isn't supposed to be killed?

Do you have to hide in order for other creatures to not know your location inside a fog cloud?

How can I print a 1 cm overhang with minimal supports?

Are stackless C++20 coroutines a problem?

Is the apartment I want to rent a scam?

Why are Oscar, India, and X-Ray (O, I, and X) not used as taxiway identifiers?



How to use OAuth2 in Google AppEngine to call an Android Device provisioning API in java


“Bad Request” (400) when using XOAUTH2 on Google's SMTP service with service accountjava.security.AccessControlException: access deniedGoogle Oauth2 in GWT and AppEngineHow can impersonate a Domain to Access Google API Admin SDK with Oauth2?Google OAuth 2.0 include_granted_scopes not working for installed appiOS Google Signin Doesn't Work Properly With New ScopesHow do I prevent the user from being asked to grant permissions for a Google Apps Marketplace app that the domain administrator has approvedHow to generate OAuth2.0 Bearer when calling App Engine Endpoints API?Re-gain user authorization after scope change in Google App EngineHow does google sign-in for Android application work?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm trying to use Android Device provisioning API as shown below.



private static Credential authorize() throws Exception 
// load client secrets
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY,
new InputStreamReader(PlusSample.class.getResourceAsStream("/client_secrets.json")));
// set up authorization code flow
GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
httpTransport, JSON_FACTORY, clientSecrets,
Collections.singleton(PlusScopes.PLUS_ME)).setDataStoreFactory(
dataStoreFactory).build();
// authorize
return new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user");



But once deployed the on app engine server, the app doesn't prompt the user to authorize the app scopes.



Meanwhile, the process work perfectly on local server.










share|improve this question






























    0















    I'm trying to use Android Device provisioning API as shown below.



    private static Credential authorize() throws Exception 
    // load client secrets
    GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY,
    new InputStreamReader(PlusSample.class.getResourceAsStream("/client_secrets.json")));
    // set up authorization code flow
    GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
    httpTransport, JSON_FACTORY, clientSecrets,
    Collections.singleton(PlusScopes.PLUS_ME)).setDataStoreFactory(
    dataStoreFactory).build();
    // authorize
    return new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user");



    But once deployed the on app engine server, the app doesn't prompt the user to authorize the app scopes.



    Meanwhile, the process work perfectly on local server.










    share|improve this question


























      0












      0








      0








      I'm trying to use Android Device provisioning API as shown below.



      private static Credential authorize() throws Exception 
      // load client secrets
      GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY,
      new InputStreamReader(PlusSample.class.getResourceAsStream("/client_secrets.json")));
      // set up authorization code flow
      GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
      httpTransport, JSON_FACTORY, clientSecrets,
      Collections.singleton(PlusScopes.PLUS_ME)).setDataStoreFactory(
      dataStoreFactory).build();
      // authorize
      return new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user");



      But once deployed the on app engine server, the app doesn't prompt the user to authorize the app scopes.



      Meanwhile, the process work perfectly on local server.










      share|improve this question
















      I'm trying to use Android Device provisioning API as shown below.



      private static Credential authorize() throws Exception 
      // load client secrets
      GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY,
      new InputStreamReader(PlusSample.class.getResourceAsStream("/client_secrets.json")));
      // set up authorization code flow
      GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
      httpTransport, JSON_FACTORY, clientSecrets,
      Collections.singleton(PlusScopes.PLUS_ME)).setDataStoreFactory(
      dataStoreFactory).build();
      // authorize
      return new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user");



      But once deployed the on app engine server, the app doesn't prompt the user to authorize the app scopes.



      Meanwhile, the process work perfectly on local server.







      google-app-engine google-oauth






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 26 at 15:45









      Alejandro Vales

      1,3838 silver badges25 bronze badges




      1,3838 silver badges25 bronze badges










      asked Mar 26 at 14:22









      xpmanDevxpmanDev

      11 bronze badge




      11 bronze badge






















          0






          active

          oldest

          votes










          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%2f55359476%2fhow-to-use-oauth2-in-google-appengine-to-call-an-android-device-provisioning-api%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          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%2f55359476%2fhow-to-use-oauth2-in-google-appengine-to-call-an-android-device-provisioning-api%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

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript