openhab-ios: Sitemap: images are not displayed

Frame elements without labels are not displayed in the iOS app.

For example:

Frame {
        [additional sitemap elements]
}

This pattern can be used to group elements in a sitemap, the label attribute is optional. The basic UI handles this correctly but the iOS app ignores the frame and only displays the inner elements.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 34 (24 by maintainers)

Most upvoted comments

Yes the refresh works perfectly. My setting is 2 seconds.

@The-Elk-GH The latest Test Flight build (2.2.50) has changes for items 2 and 3 from my previous post. I don’t think 1 is necessary to resolve this. The changes fixed the issue that I was able to reproduce but could you try this out and see if it resolves your issue? From my understanding of your setup, you’ll want to ensure that the “Always Send Credentials” setting is turned off (which should be the default already). This will ensure that when connecting locally to OpenHAB that the app won’t send the user/password unless the server challenges for it.

Your previous test of removing the username and password probably didn’t fix your issue at the time because the app was sending an Authorization header regardless of whether the settings had a username/password set.

Sure, I’ll have a look. Hopefully will have some time to have a look next week.

@timbms I just had a look at how basic auth is handled in the iOS app and I think that gives a hint as to why the Android app works. It looks like the iOS app sets the Authorization header in all http(s) requests regardless of whether the credentials have been requested. I think a normal flow would be that a request is made without the credentials, the server would return a 401 which would then trigger another request with the credentials added.

I quickly stubbed something in that only adds the credentials when the challenge if offered (the same way the client and server certificate handling is done) and it looks like it will work and would avoid needing to add separate credentials for the local vs remote as I suggested earlier.

When I get that working properly I can submit a PR.

Although I haven’t tried to reproduce this issue, it’s possibly the same root cause as #300. I added some details there.

As to why it works with myopenhab.org and not the local connection: I would speculate that it is related to my comment in #300. It’s possible that myopenhab.org strips the Authorization header before it proxies to your openhab instance thus avoiding the problem.

Fixing this issue likely requires a different approach though since I’m assuming there is no nginx proxy in this case because myopenhab.org is being used instead.

If the setup is such that myopenhab.org use for the “Remote URL” and the openhab URL itself is used for the “Local URL” then a simple fix might be to support different username/password combos for remote and local URLs and then leave the local URL credentials blank.

An alternative not requiring a change to the iOS app could be to add nginx to the local setup and have it strip the Authorization header.

@timbms I’ll take a look when I can get my environment up and working again (hopefully soon).

For me the question is: Why do it work with the remote connection via myopenhab.org? And why don’t work with the local one?

Authorization seems to be handled differently when connect through myopenhab.org (see #300 for a similar problem). But I’m only guessing atm. As mentioned, I’ll have to set up a test case to further analyze the issue.