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.
Related
I have a React app on 127.0.0.1:3000 / 192.168.0.104:3000 and a Laravel api on 127.0.0.1:8000.
My problem is, I can fetch the data on my computer (127.0.0.1), but it seems that the React app can't correctly get the data from the database when I access the React app from my phone on LAN (192.168.0.103).(I can see the React app)
Can someone help me to solve this problem or tell me what may cause this? Thank you.
I suspect you have a CORS policy error. I'm not familiar with Laravel cause you know, PHP, but a quick google search would probably tell you how to allow a foreign domain to have access to your api.
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
To verify you have a cors policy error, you'd have to open dev tools and take a look at the errors. However, I'm unsure if that's possible on a mobile browser. I never tried, so it could be possible. Again another google search would answer that for you.
I just solved this problem by myself. It is because that the client can not find the Laravel API on LAN. In Img A the port 8000 is not open on the machine, so the client can't access the API.
Img A
My solution is that host the API and APP on the different machine and make sure that the client can access both the APP and API.
Img B
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.
please help me with the following problem as it already taken me so much time to figure out:
I have an API which I created using PHP and hosted with AWS EC2.
This API is to be consumed by a React frontend app I made, and when I am developing the frontend there are no problems sending and receiving data from the API.
However, after I deploy the app using AWS Amplify, the app loads correctly but fails to connect to the api(i.e. not showing fetched data, unable to post forms)
I read a little bit about proxying but I am not sure it is the solution and if so, how would I implement it.
Thanks a lot in advance.
I resolved the issue.
My problem was that the server was not listening to https port, so the browser blocked the content.
I am new to React and created a simple react app using create-react-app , it builds and runs fine on local. I created a Azure Build and release pipelines and tried deploying using App Services , refereed below Microsoft link to implement the same.
https://devblogs.microsoft.com/premier-developer/deploying-react-apps-to-azure-with-azure-devops/
Build and release pipeline runs successfully however when I click the Azure app services link to access the react app, I receive below message :-(
"This react-naturalone.azurewebsites.net page can’t be found
No web page was found for the web address: https://react-naturalone.azurewebsites.net/
HTTP ERROR 404"
Can someone please suggest what I am missing.
fyi, I am using react-router, hence added the web.config as mentioned in the link above.
Thanks
AOU
I'm thinking that there is a problem with your deployment pipeline. The first step for your here is to go to your Azure portal and open up your app service. From your app service, go to -->Development tools --> App service editor.
Do you see your code inside it? If you don't, you can confirm that the code didn't deploy correctly. If you do, then you have a misconfiguration somewhere in your app that is preventing anybody from seeing it.
I'm not able to find a small example (or tutorial) of Android App (possibly with Android Studio) that use Authenticated Endpoints realized with GAE (possibly Python).
Google examples (Greetings and Tic Tac Toe) seems have some problem in my environment (token error, 404 not found, .....).
Can anyone help me? I'm going crazy...
Thank you in advance.
Are you able to access your Endpoint from api Explorer on localhost(http://localhost:8080/_ah/api/explorer ) you can even simulate authentication there.
if API explorer is working then you need to check how you define SCOPE when getting credentials.
In my experience I had problems in following areas:
1. Generating Client IDs
2. define scoping in Endpoint API
3. Specifying correct scope in android App (server:client_id:123456789-abcdefghsadffwe.apps.googleusercontent.com";
I'm finally able to do it.
I used this 2 google examples:
On the server side:
https://github.com/GoogleCloudPlatform/appengine-endpoints-helloendpoints-python
On the client side:
https://github.com/GoogleCloudPlatform/appengine-endpoints-helloendpoints-android
The instructions inside this pages are, in my opinion, better than the official google documentation.