Token error in Google Apps Marketplace application - google-app-engine

We have a Google Apps Marketplace app which is deployed on App Engine, and uses the gdata APIs and as of a 3 days ago (20 of June) we started getting this error in the logs:
Unauthorized - Server responded with: 401, <HTML>
<HEAD>
<TITLE>Token invalid - Target is disabled.</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Token invalid - Target is disabled.</H1>
<H2>Error 401</H2>
</BODY>
</HTML>
This is the piece of code that raises the error:
two_legged_oauth_token = gdata.gauth.TwoLeggedOAuthHmacToken(CONSUMER_KEY, CONSUMER_SECRET, admin_email)
# Email Settings API client
email_settings_client = gdata.apps.emailsettings.client.EmailSettingsClient(domain=domain)
email_settings_client.auth_token = two_legged_oauth_token
sig = email_settings_client.RetrieveSignature(username=guid) #this line throws the error
I know the APIs and the two legged auth are about to be deprecated, but Google says it's not supposed to happen until next month or so. Nothing in the code or the servers has changed, so I'm not sure what the error says, and googling hasn't provided me with any insights. What this might mean?

Just a long shot, but if you are using OpenId for authentication, this service may have been closed down.
Here you find important migration details : https://developers.google.com/+/api/auth-migration

Related

Google Login failed {error: 'popup_closed_by_user'} on Google login in Django

I am aware that this question has been asked multiple times. However, they were usually issues related to localhost.
I have a django site where I used react for the frontend.
Everything runs perfectly when I have my react at port 3000 and django at 8000. Even the google login
But when I run
npm run build
I pasted the build folder in the django root and make all the changes in settings.py
Now I directly went to localhost:8000
this error shows up on google login
Manifest: Line: 1, column: 1, Syntax error.
Google Login failed {error: 'popup_closed_by_user'}
sometimes its even a 403 error.
I tried it on both localhost and heroku and it won't work.
I've been stuck on this for days. Would appreciate some help
Your authorized javascript origin seems correct.
In the Authorized redirect URI you have also set the base url which is not correct. If you have used some package in django for google authentication; they have given you the endpoints. Like here is the example for the social-auth
http://127.0.0.1:8000/social-auth/complete/google-oauth2/
https://some-heroku-base-url/social-auth/complete/google-oauth2/

Sitecore JSS (Headless) + React. Can not deploy app. Status: 403

I am trying to deploy my first react app.
I have followed all the steps according to the instructions.
But when it comes to app deployment I keep getting the same message.
Unexpected response from import status service. The import task is probably still running; check the Sitecore logs for details.
Status message:
Status: [403]
Can anyone help me with this?
Hosts added
Confings and the error
Api is working
please go through my comment on : 403 error when importing a new JSS app to Sitecore 10.2
also make sure your API key and layout service is configured properly e.g. http://myapp.siteco.re/sitecore/api/layout/render/jss?item=/&sc_apikey={YOUR_API_KEY_ID}
Similar kind of issue: 403 error when importing a new JSS app to Sitecore 10.2

Firebase Google Authentication works on localhost, but not on Netlify hosted site

I have a React website that I'm hosting and deploying through Netlify. I have it currently set up so that I'm able to log in using their authentication service, which is useful. However, it only works on my Localhost. When I try to use it on the Netlify hosted site, I get the following error:
Uncaught (in promise) Error: Illegal url for new iframe - https://%22trail-app-7d2e3.firebaseapp.com%22/__/auth/iframe?apiKey=********&appName=%5BDEFAULT%5D&v=9.2.0&eid=p&usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en.ILxaxn5iF9E.O%2Fam%3DAQ%2Fd%3D1%2Frs%3DAGLTcCP4GH4pdEaIiZe1k-cWfBRo9KTiAQ%2Fm%3D__features__#id=I0_1635906033796&_gfid=I0_1635906033796&parent=https%3A%2F%2Ftrailapp.netlify.app&pfname=&rpctoken=37134086
at Object._.Zk (cb=gapi.loaded_0:154)
at Fl (cb=gapi.loaded_0:165)
at Object._.Gl (cb=gapi.loaded_0:166)
at Object._.Nl (cb=gapi.loaded_0:172)
at _.Ym.openChild (cb=gapi.loaded_0:310)
at _.Ym.open (cb=gapi.loaded_0:315)
at iframe.ts:81
at l (runtime.js:63)
at Generator._invoke (runtime.js:294)
at Generator.next (runtime.js:119)
It seems as though it's trying to use that URL to reference a script that presents the iframe with the Google login. I'm not sure what permissions would be causing it not to work. I've enabled everything I know to.
I am using a .env file to hide my API information from a repository and have the values set up under "Environment Variables" on Netlify. If anyone has any feedback it'd be greatly appreciated!
You need to add your hosted domain in firebase as I have added my own domain here.

Google App Engine Deployment fais with Intellij idea

I am developing a Google App Engine application with IntelliJ idea, the app is running successfully on local machine but when I need to deploy it on my cloud it fails and I get the following error :
Password for myemail#gmail.com:
java.lang.RuntimeException: Bad authentication response: 404 Not Found
Unable to update app: Bad authentication response: 404 Not Found
please see the log
Having checked the log file the content was:
java.lang.RuntimeException: Bad authentication response: 404 Not Found
at com.google.appengine.tools.admin.ClientLoginServerConnection.getAuthToken(ClientLoginServerConnection.java:250)
at com.google.appengine.tools.admin.ClientLoginServerConnection.authenticate(ClientLoginServerConnection.java:86)
at com.google.appengine.tools.admin.ClientLoginServerConnection.doHandleSendErrors(ClientLoginServerConnection.java:120)
at com.google.appengine.tools.admin.AbstractServerConnection.send1(AbstractServerConnection.java:296)
at com.google.appengine.tools.admin.AbstractServerConnection.send(AbstractServerConnection.java:253)
at com.google.appengine.tools.admin.AbstractServerConnection.post(AbstractServerConnection.java:232)
at com.google.appengine.tools.admin.LoggingClientDeploySender.send(LoggingClientDeploySender.java:47)
at com.google.appengine.tools.admin.ResourceLimits.remoteRequest(ResourceLimits.java:173)
at com.google.appengine.tools.admin.ResourceLimits.request(ResourceLimits.java:139)
at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:467)
at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:55)
at com.google.appengine.tools.admin.AppCfg$UpdateAction.execute(AppCfg.java:1347)
at com.google.appengine.tools.admin.AppCfg.executeAction(AppCfg.java:332)
at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:213)
at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:124)
at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:120)
Caused by: java.io.FileNotFoundException: https://www.google.com/accounts/ClientLogin
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1834)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1439)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at com.google.appengine.tools.admin.AbstractServerConnection.connect(AbstractServerConnection.java:133)
at
I also have searched for this error and I think this link should address this issue
Issue 12898: Some AppEngine deploys are failing
I uploaded a picture from the setting up App Engine deployment,
Question : What exactly should I change in order to get it working and successfully deploying on the App Engine Server?
I solved the issue by appcfg.cmd [options] update <war-location> and adding the argument --oauth2 to the command it should have been also solved by updating the sdk versionas mentioned in comments

Configuring GAE Remote API on the Server

The introduction to Remote API for Java at https://developers.google.com/appengine/docs/java/tools/remoteapi runs fine but I just get 404 errors:
Exception in thread "main" java.io.IOException: can't get appId from remote api; status code = 404, body:
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>404 Not Found</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Not Found</h1>
<h2>The requested URL <code>/remote_api</code> was not found on this server.</h2>
<h2></h2>
</body></html>
I believe this to be because the server is not configured correctly. The instructions in the section ‘Configuring Remote API on the Server’ are too vague for me – beginner.
The statement ‘add the following to your web.xml’ is the problem. I am not sure which web.xml this statement refers to. Putting web.xml in various obvious places eg war/WEB-INF/web.xml doesn’t seem to help. Also tried this as a Dynamic Web project (in Eclipse) with the xml code in WebContent/WEB-INF/web.xml , which also doesn’t help.
Looks like a basic misunderstanding of the structure of a Java project that uses Remote API but can’t see the way forward. Advice would be greatly appreciated.
In this case, that it's a one-module application, the web.xml file is located directly in the directory war/WEB-INF.
You could build a full sample application for Google App Engine by following this tutorial.
Also the Google Plugin for Eclipse would create a similar sample app for you.

Resources