GMail API Node.js quickstart - ERR_CONNECTION_REFUSED - gmail-api

I am trying the GMail API Node.js quickstart on Windows 10.
I do get the expected
.
However when I visit the url I get
for http://localhost/?code=4/xxxxxxxxxxxxxxxxxx&scope=https://www.googleapis.com/auth/gmail.radonly
I get this error after going through 'This app isn't verified'/'Advanced > Go to {Project Name} (unsafe)'. message.
No Proxy active and also tried with AntiVirus disabled.
Any ideas what the problem could be?
Thanks.

The issue you are having is that you are runing a Authorization credentials for a desktop application. Google made a change recently which deprecated the oob redirect. This means that now you need to use localhost or 127.0.0.1 as a redirect endpoint for installed applications.
Resulting them in returning the authorization code back to the browser showing site can not be reached because your not running a web app you are running an installed application.
If you check the url the authorization code you are looking for to add to your code can be found there. just take that code and submit it where it asks for it.
Enter the code from that page here:
There is currently no other option and no way to fix this unless you want to start up a web server in node. basicly its working as intended and Google is in the process of updating all the Javascript samples to reflect that.

Related

AWS Chime Error - SDK Chat Demo - WebSocket close: 4401 Unauthorized

I'm trying to integrate the AWS Chime Demo Chat application into my react application. The Demo application works fine when ran individually. But after integrating it with my react app, I'm getting an error - [INFO] SDK Chat Demo - WebSocket close: 4401 Unauthorized. What could be the reason for the same? Thanks!
There are three potential reasons for that.
1: You are not using HTTPS protocol. It will only work if your Backend and Frontend are being served over HTTPS (Even in dev env). Here is an app I worked on for your reference (Built using Angular, Nodejs, and Chime).
2: You are providing invalid credentials.
3: The IAM role is not set up properly. Read More
Please check the credential you are providing, make sure the appInstanceArn is correct.
Also check whether user instance is created for a particular user.
Above may not be the proper solution but
i was facing this same issue and i found that i was providing the wrong app instance arn in env file.

VueJS PWA says Network Error in my small PWA. Even I can't login

In my PWA everything is working except POST HTTP calls. I have a login on my first screen. It says Network Error. But it works fine Desktop/Laptop web browser. Only found the problem on mobile app [Android]
Note
I used Vue CLI for creating project.
I also tried with React. Happened the same. I don't know what's wrong with me.
You most likely try to connect to localhost. When deploying to a different device localhost is the actual device you are deploying and most likely you are not running a web server there.
You need to find your local machine's ip and use that as base url for HTTP calls.

Is FireBase hosting dependent?

I created a very simple FireBase + Angular app with AngularFire, or rather, I copied the code from the examples. All it does, for now, is allow logging in and out via Google. The code is so simple I don't think there's even a need to post it here.
I tried it on different static files hosting solutions, and got somewhat weird results.
On Google Drive, Dropbox, and Github. Though the pages were served on all of them, no 404 error and no JS errors in the console, the login itself didn't work. What would happen is that the program would launch the login screen and log in the user, but then the angular "auth.user" object stayed null.
The same code exactly, when run on Visual Studio (just by "view file in browser") and also hosted on FireBase's own hosting solution, ran as expected, no problems. Logging in and logging out both worked.
I wondered how that could be, since this is a "no backend" app, or, more precisely, it has the same back-end, i.e. FireBase services.
What is happening here?
explanation on hosting on Google Drive
explanation on hosting on Dropbox and Github
(comments on how to improve this question will be appriciated)
You have to liste the domains that will host your app in the settings of FireBase.
It is in the login and auth tab, the "Authorized Domains for OAuth Redirects" field.
You should put there the domains you want to use, like dropbox.com, etc...
Details here : https://www.firebase.com/docs/web/guide/user-auth.html#section-configuring
Your code works on your local Visual Studio because localhost and 127.0.0.1 are enabled by default.

CORS issue browsing Mac localhost app that uses Auth0 from IE11 in Parallels

We've got an Angular app that uses Auth0 for SSO login. We primarily use Macs and develop and test locally using the localhost web server. Browsing the site locally using browsers on Mac works fine. We can authenticate and the subsequent redirect does the right thing. The problem is browsing with IE. We can connect to the localhost web server on OS X using the IP address. We had to edit the Windows hosts file to map the Mac's IP address to localhost due to our app using full URLs/URIs as primary keys, so that the keys match.
When I browse the site using IE11 on Parallels, login using Auth0, it looks to authenticate just fine, but afterwards, we get an error when it tries to redirect:
XMLHttpRequest for https://mindjet.auth0.com/tokeninfo? required Cross Origin Resource Sharing (CORS).
Auth0 does have a field for specifying allowed CORS origins, and I tried every conceivable URL that our app exposes, even just *. But nothing worked. In our Angular app, I've tried setting $httpProvider.defaults.useXDomain = true; That didn't work either. I'm new to the CORS concept, so any insights would be greatly appreciated. We just want to find a way to test with IE without having to deploy to a dev server.
Our main issue that we couldn't test with IE11 seems to have been resolved by updating our auth0-angular and auth0-widget libraries to the latest version. I still occasionally see warnings about CORS issues in the console, but we are able to login and get redirected to the correct part of our app.

Can't deploy to GAE - the application doesn't exist

Using Eclipse, I am experiencing an error when trying to deploy a rather basic web app with JAX-RS and JAXB. It runs okay locally, but when trying it on the remote servers I get the message shown below...
'Deploying to Google' has encountered a problem / This application does not exist
Below shows my appengine-web.xml
The XML file illustrates that I am using the same name in the xml as what's specified in the project properties...
The output window show...
------------ Deploying frontend ------------
Preparing to deploy:
Created staging directory at: '/var/folders/n8/6by626014jbfc0dwmxnb0ly00000gn/T/appcfg2754901216637807129.tmp'
Scanning for jsp files.
Scanning files on local disk.
Initiating update.
com.google.appengine.tools.admin.HttpIoException: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=hillingarincident&version=0&
404 Not Found
This application does not exist (app_id=u'hillingarincident').
Debugging information may be found in /private/var/folders/n8/6by626014jbfc0dwmxnb0ly00000gn/T/appengine-deploy447984481661870877.log
The referenced debug logs show...
Unable to update:
com.google.appengine.tools.admin.HttpIoException: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=hillingarincident&version=0&
404 Not Found
This application does not exist (app_id=u'hillingarincident').
at com.google.appengine.tools.admin.AbstractServerConnection.send1(AbstractServerConnection.java:293)
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.AppVersionUpload.send(AppVersionUpload.java:644)
at com.google.appengine.tools.admin.AppVersionUpload.beginTransaction(AppVersionUpload.java:449)
at com.google.appengine.tools.admin.AppVersionUpload.doUpload(AppVersionUpload.java:124)
at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:371)
at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:53)
at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:433)
at com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:148)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Any answers will be appreciated. At one point my browser was not logged in to the target google account, so I swapped to the correct one a little later, Google does render the application name as expected.
Okay, this was simple in the end! Eclipse performs an auto-login to the Google account, unfortunately I created the Eclipse project whilst being logged in to one Google account and then tried to specify the application name afterwards.
You'll see in the bottom-right (or bottom-left in some versions) a Google icon with the name of the user that you are logged in as. If that's not the account where your application is defined, then simply logout of that account, then login as the correct Google account.
Now there's no error :-)
I know this question is super old but I had this issue all day and finally I found a solution. Maybe it will help someone out in the future.
After you create a project in Google Cloud Platform, you must go to google cloud shell in your project and run the command
gcloud beta app create
After you run this command, you will get prompted to choose a region. Then go back to eclipse and try deploying it. It worked for me.
There are not just 1 way can cause this problem. For me, I have this problem when I create the project using Maven. But I don't have the same issue if I directly create the project from the Google plugin.
There might be another issue, when you register with Google App Engine, you receive email indicating your activation. If you have not received the email yet, this problem could occur too.
Another issue could be to use the gmail account for the Google App Engine to avoid any such errors.

Resources