tobychui / arozos

Web Desktop Operating System for low power platforms, Now written in Go!
http://arozos.com
GNU General Public License v3.0
1.87k stars 138 forks source link

[BUG] Not able to login when included in other webservice, logs says login is accepted. #163

Open Bartiiee opened 1 week ago

Bartiiee commented 1 week ago

Describe the bug I'm trying to include the server in this example in gather.town. The page loads fine, but I can't login.

To Reproduce Steps to reproduce the behavior: Can't give you my login, but if needed, I can add you to my gather space so you can check.

Expected behavior If the page loads, being able to login. If the goal is not to let a kind off include happen, not to be able to load the page.

Screenshots Log shows this: image

Host Information(please complete the following information):

Client Information(please complete the following information):

Additional context I'll search further by myself but coudln't figure it out today.

tobychui commented 1 week ago

@Bartiiee That is by design in term of web security. CORS and some X-frame-options disable such login from cross origin domains (e.g. your own domain that open the web desktop interface, which is different from the 3rd party website you try to embed). Not all webapps are supported by the direct iframe-ing of their website. You might need some networking background to understand this, but in simple words, you will need some kind of reverse proxy in between to be able to "trick" it thinking you are opening their website directly.

If you have further issues regarding embedding external service (e.g. gather.town) into your arozos web desktop, seek help from them instead. It is a limitation apply by the 3rd party website and it is not a bug from ArozOS.

For that login log screenshot, it is for ArozOS login but not other login within the embed float-windows. I guess it got nothing to do with your issues here.

Bartiiee commented 1 week ago

I think the question is interpret backwards. I want to embad arozos into gather, not the other way arround. I'll explain with more images.

In gather I make an object which loads an external website, I guess it is with an iFrame. It opens like this: image

So Arozos is available to show it's interface when embedded. It's when I go further and try to login that it doesn't do anything. It just reloads front like in picture above, I don't get an error, the backlog shows the login was succesful (therefore the picture of the backlog in opening post).

I do have a background in networking and development, not that much and very basic on this topic. But I would expect Arozos to do one of the following:

I do have my workaround because it does work when I open a dockorized browser and embed that, I can login and it works fine.

I'll search in the gather docs also to see if it is something on their side which is blocking it and try embedding Arozos in another site to see what that does.

Update: Seems I accedentely closed the topic.

tobychui commented 1 week ago

@Bartiiee Well then it is an interesting use cases. Anyway, regarding the issues you saw,

  1. "Not letting you to embed into 3rd party software" should be your HTTP reverse proxy's job. ArozOS by default allow CORS from * so you can embed it into and from any other webpage. That is really helpful when you are trying to integrate ArozOS into other products.
  2. The login interface do have error handling in place. The reason you don't see an error is mostly due to the fact that the error was not caused by ArozOS but something else that is out of the scope of this system.
  3. I tested logging in ArozOS using an iframe to another ArozOS node and everything works fine on my machine.

圖片 圖片

Bartiiee commented 1 week ago

Thx for the fast replies!

I tested further and an iframe gives me same result. With your confirmation that it does work, seems like a proxy problem here indeed. I'll try further and try to resolve it with the manager I use (npm) or in another way. If I just start the server on port 80 I can use the dns of one of my domains and try it that way, but I try to use npm last time for projects since that's easer to keep clean.

I'll report if I find a solution for should there be others that run into the same problem.

I'm very open to explain the use case but this isn't the right place to do that. But you may always ask if interested.

tobychui commented 1 week ago

@Bartiiee Have you tried Zoraxy instead of NPM? My best guess will be your reverse proxy having trouble rewriting the Location header required for redirection after logged in.

I will not be surprised by any weird use case of ArozOS now after I have open source this project for 6 years. I saw people installing it on their USB sticks with a portable Linux, hacking a 5G WiFi router with Qualcomm chip to run ArozOS or deploy on an old POS machine with a 10 years old Intel Atom processor. The fun part is, it all worked and every time something like this pops up makes me question the accuracy of the "system minimum requirement" I wrote for my doc 🤔

Bartiiee commented 1 week ago

Indeed, redirect is the problem, but I have it also wit Zoraxy (I found it yesterday in searching and installed it today. Seems very neat, looks like a great replacement voor npm. I'm gonna test it out a little).

I keep getting this error in console, npm and Zaroxy image

Gonna check my settings everywhere to see if I didn't make a mistake. Seems like it should just work and it probebly does but I'm still learning a lot about selfhosting and networking. Tought myself more about webdesign until now but this is also so much fun).

I've been looking for software like this for years, webtop device not to demanding, not to bulky. Found yours only a couple of months back and just found the time to start experimenting. Tried things like Kasm (very good, very expensive for my use case, very demanding), FriendOS (stopped developping for a while, seems great too, has some features like a build in communication platform for own users which I really like, but installing is a pita (or was, I didn't try the last year).

But the thing I wanted to do with it, is have something for myself to always work while on the road and an interface that always looks the same. So I can use my windows laptop, Chromebook, Android tablet or a Linux or Mac device and still be able to work in the same environment, preferably with a storage attached so I don't need the usb drives or stuff like that (yes, you can mount shares and dropbox and Onedrive and ... to every devices, but more useful to login to a OS and have it linked there in stead of on 10 decices). And besides that, I still do some volounteerwork where I have a team that needs to do some computer work in front. We don't see eachother much but there are fun things like Gather.town or other virtual offices where you can interact but also work, if you have the right software. So embedding software like this is super cool to do that. I wanna change that to Workadventure which you can also selfhost (but didn't get it to work yet). But would be fun to be able to do it, do some work with other people online and take breaks an relax with included games (or selfhosted, that another next stop).

Just to trigger the interest, looks like this (basic test thing, there is so much more possible :) ): image

tobychui commented 5 days ago

But the thing I wanted to do with it, is have something for myself to always work while on the road and an interface that always looks the same. So I can use my windows laptop, Chromebook, Android tablet or a Linux or Mac device and still be able to work in the same environment, preferably with a storage attached so I don't need the usb drives or stuff like that (yes, you can mount shares and dropbox and Onedrive and ... to every devices, but more useful to login to a OS and have it linked there in stead of on 10 decices).

So cool you are using ArozOS exactly what I design it for! I use ArozOS similarly to your use case but in my university lab where I can easily swap between my laptop and computers in the lab between lecture breaks.

I have never used and self hosted Gather.town before, but if you can create me a user account, maybe I can test it out for you on your instance?

Bartiiee commented 5 days ago

I'm not selhosting yet, but gather.town is free for up to 10 users. So I'm first trying there before setting up selfhosted (that's another version to selfhost, workadventure.re). Selfhosting that part will be experimented with when I'm on vacation (I do it at a school so in a week of 3, lots of Azure migrating work and resetting work before I can have a break).

But I'm still struggeling with the iframe include. there must be something I'm missing. I have an instance on OVHcloud and OracleCloud a.t.m.. Just to test (I'll probaly run it from home eventualy but again, setting up a physical server is when i'm on my break). Both show the same problem. Even with Zoraxy.

I'll send you my url and a login so you can check in an iframe if it works for you. But I'll keep tinkering.

Bartiiee commented 4 days ago

Got a bit furter. It works in Firefox and Palemoon. Chrome and Edge don't work.

I'm googling a bit and find things about cookie settings that have to be changed for Chromium to work. I keep digging

https://www.kevel.com/blog/chrome-samesite https://www.mediawiki.org/wiki/Manual:%24wgCookieSameSite