AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Forge Web Frontend Google Cloud OAuth does not accept 127.0.0.1 loopback address

Open shouhanzen opened this issue 2 years ago • 13 comments

⚠️ Search for existing issues first ⚠️

  • [X] I have searched the existing issues, and there is no existing issue for my problem

Which Operating System are you using?

Windows

Which version of AutoGPT are you using?

Latest Release

Do you use OpenAI GPT-3 or GPT-4?

GPT-3.5

Which area covers your issue best?

Installation and setup

Describe your issue.

I followed the Quickstart guide on Windows in WSL.

When trying to log into the web frontend using Google OAuth, the process worked with localhost:8000 but not 127.0.0.1:8000 I ran into this issue because I use VSCode which converts localhost to 127.0.0.1 when clicking through links.

I met somebody on the AutoGPT discord who had a similar issue, leading me to think that this may be somewhat common.

Upload Activity Log Content

No response

Upload Error Log Content

No response

shouhanzen avatar Oct 16 '23 01:10 shouhanzen

I am facing the same problem but I changed uvicorn to run on 0.0.0.0:8000 Github popup to login diseappers very fast. Google popup appears but with error: Access blocked: This app’s request is invalid - error 400: redirect_uri_mismatch

In the console, I see:

Info: The current domain is not authorized for OAuth operations. This will prevent signInWithPopup, signInWithRedirect, linkWithPopup and linkWithRedirect from working. Add your domain (xxx.local) to the OAuth redirect domains list in the Firebase console -> Authentication -> Settings -> Authorized domains tab. Not sure about the bets approach to go around it.

shuther avatar Nov 02 '23 11:11 shuther

Accessing http://localhost:8000 not http://0.0.0.0:8000 solved the problem in my case

jihun-im avatar Dec 18 '23 08:12 jihun-im

I also encountered the same problem,Why hasn't anyone answered?

zhangwzhang avatar Dec 26 '23 01:12 zhangwzhang

me too why

zhqsdhr avatar Dec 28 '23 09:12 zhqsdhr

我面临着同样的问题,但我将 uvicorn 更改为在 0.0.0.0:8000 Github 弹出窗口上运行,以非常快地登录 disappers。 出现 Google 弹出窗口,但出现错误:访问被阻止:此应用程序的请求无效 - 错误 400:redirect_uri_mismatch

在控制台中,我看到:

信息:当前域未获得 OAuth 操作授权。这将阻止signInWithPopup、signInWithRedirect、linkWithPopup 和linkWithRedirect 工作。将您的域 (xxx.local) 添加到 Firebase 控制台 -> 身份验证 -> 设置 -> 授权域选项卡中的 OAuth 重定向域列表。 不确定绕过它的投注方法。

How to set the UVICORN address

zhqsdhr avatar Dec 28 '23 10:12 zhqsdhr

This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days.

github-actions[bot] avatar Feb 17 '24 01:02 github-actions[bot]

same problem

ozyurterdem avatar Feb 22 '24 16:02 ozyurterdem

exactly the same problem for me, it's like the authentication part is keeping me stuck of using the web interface only on the same machine as the server, i would have prefered to be able to have autogpt running in one server and access it from various remote computer. the url mismatch is like the permission for the autogpt application are locked on the localhost and then can't apply to any other uri, I guess the only way to "correct" it is by creating a google app with permission of authentication, setting it to return to the domain/uri you want it to point back and then you'll be able to use another uri than localhost but again it's just a guess, if anyone already did it please give the walkthrought and the files to edit.

EDIT: So i just searched a bit in the code and found a few reference to "googleusercontent.com", their are file for ios, android and web so change the one you need, next you'll have to setup your google account to have access to console.cloud.google.com this way you'll have to: 1 - create a screen authentication Oauth (4th item on the nav bar), i just allowed the email part for now, i'll test to find what is missing later 2 - create an identification item in the 3rd item of the nav bar, choose a ID client OAuth, and in this part you'll find out that you simply can't put ip, you have to put a real domain and by the way localhost is one of those who are allowed, if you don't want to register a domain simply add a name in your host file and it will loop back to you directly (autogpt.org or com for exemple, keep in mind any other extension won't be allowed so be sure to use something you'll never miss or don't exist) 3 - update with the new id in the files you found while grepping before the 1st step EDIT2: once the index.html and the authservice.dart are updated witth the new client id you'll then be able to recompile the application using flutter (simply run the build.sh in the frontend folder) and then you'll see something magik, the authentication service is not directly stuck on the current user but let you choose between the google account you have (and add another one) and her we have a big step forward, we can login but nothing happen, then opening the console give a huge hint: people api isn't actif, then: 1 - Open the cloud console again 2- search for the people api in the first item of the navbar (API and services) and enable it, you'll see in the managerment part of the api your authentication created in the previous step 3 - refresh the application page and try to login again, you'll get a new error (yeah) it's about firebase, i'll update when i'll figure out how to clear the path Edit3: last part: 1 - go to firebase console and create an application linked to the one you juste created in the google cloud console 2 - open all application in firebase and select authentication 3 - select google and activate it (check it from grey to blue) 4 - copy past the configuration on the different config file (simply grep on the google project "387****76242" you should be able to find the real string in the code easyli) 5 - rebuild the project 6 - run it 7 - login in 8 - enjoy it from anywhere

REMINDER: be carefull, since autogpt can create file and edit anything in it's environement and outside of it you should be very carreful as to when you run your service and WHO can access it, it can be very dangerous if anyone unothorized have access or even someone who simply don't know what he is doing, i've just shared my walkthrought with you as to avoid being stuck because of that authentication part. You can also easyli adapt it to work only in your local entreprise network by binding it only to the "local" google workgroup, also you'll have to add a custome entry in the main rooter in order to determine the custom domain (you did it in the host right her but you should do it in the router part if you want all the machine to have it without configuring them one by one), if you ant to it's also feasible using gpo strategy

yechoua avatar Mar 13 '24 09:03 yechoua

We do this because the front end was designed for local use only. There aren’t security considerations or verifications that would need to be done if it was quickly hostable

ntindle avatar Mar 13 '24 12:03 ntindle

We do this because the front end was designed for local use only. There aren’t security considerations or verifications that would need to be done if it was quickly hostable

I understand but a lot of windows users activate their wsl2 only for this project and then they are stuck to alway keep an rdp page open without having all the favs etc inside, that's the only reason most of the users are looking for local access from same network, for thoses looking for a saas solution i guess they are aware of what can be dangerous for them plus i added a little reminder specially for those who don't know what they are doing

yechoua avatar Mar 13 '24 12:03 yechoua

This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days.

github-actions[bot] avatar May 03 '24 01:05 github-actions[bot]

This issue was closed automatically because it has been stale for 10 days with no activity.

github-actions[bot] avatar May 13 '24 01:05 github-actions[bot]

We do this because the front end was designed for local use only. There aren’t security considerations or verifications that would need to be done if it was quickly hostable

I understand but a lot of windows users activate their wsl2 only for this project and then they are stuck to alway keep an rdp page open without having all the favs etc inside, that's the only reason most of the users are looking for local access from same network, for thoses looking for a saas solution i guess they are aware of what can be dangerous for them plus i added a little reminder specially for those who don't know what they are doing

Fair, I'll put it in the good first issue category

ntindle avatar May 13 '24 06:05 ntindle