GardenaAccountHandler - Error 403 Forbidden,"User is not authorized to access this resource with an explicit deny"

Hi There

I have have a problem with the Gardena-Binding for 2 months. I have OpenHab 3.4.2 (updateted from 3.4.0 last weekend).
My system runs in the following error after 3-5 days:

[ternal.handler.GardenaAccountHandler] - Error 403 Forbidden, {“Message”:“User is not authorized to access this resource with an explicit deny”}

When I create a new API-Key and secret, then it works vor some days and runs in the error again.
In the github someone talks about a fix - but I can’t find it fpor download anywhere.
Have someone an idea how I can fix the error?

update 25.04.2023: I have made the upgrade to 3.4.3, the problem isn’t fixed. I have see there should be a solution in [gardena] Fix keep-alive logic leading to blocked account (403/Forbidden) by maniac103 · Pull Request #14203 · openhab/openhab-addons · GitHub , can me tell me someone where I can download the fixed binding?

1 Like

@JayT you can get the latest .jar for OH4.0 from here.

Is there also a version for OH3.4?

it was fixed yesterday in the 3.4.x branch but neither a new 3.4 patch nor a build .jar file has been released yet. you have to build your own jar file with the repo or wait until the next release.
another topic

Maybe you can use the gardena-jar-File for 3.4.4 from https://ci.openhab.org/view/All/job/sandbox-openhab3-patch-release/129/
My 3.4.3 accepts the gardena 3.4.4-jar from yesterday - my test with the local install is running now

I tried downloading the jar, but the download
https://openhab.jfrog.io/openhab/sandbox-release/org/openhab/addons/bundles/org.openhab.binding.gardena/3.4.4/org.openhab.binding.gardena-3.4.4.jar
leads to an error message…

here is a working .jar file.

1 Like

the file was deleted … :roll_eyes:

take it from here now: sandbox-openhab3-patch-release [Jenkins]

The full build seems to run in the morning. I observed that after the build is finished the files are available…

2 Likes

I have the same problem. Tried the latest 3.4.4 jar. But without success. I still have the same error in the logs:

2023-05-05 19:27:31.182 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 403 Forbidden, {"Message":"User is not authorized to access this resource with an explicit deny"}

same here

Once your token is blocked, you’ll need to generate a new one in the Husqvarna portal. The fix just ensures the (then newly generated) token is not blocked again.

1 Like

thanks! that was the missing point :slight_smile:

Hi all, many thanks for all the information and the fix. Wanted to finally start using my Gardena irrigation solution again and was running into this issue as well, currently running OH3.3.0.

Now I want to upgrade from OH3.3.0 to OH3.4.4 which should resolve the issue for me, as far as I understand (plus I need to generate a new token). Before doing so, I have a funny question:

When looking at the (3.4) release notes, it says: “Due to Husqvarna Authentication API change, bridge now requires application secret instead of username and password. Delete any existing bridge and re-add it, please make sure to update all automower things to use the newly added bridge.

Just to be on the safe side, as I have not touched my OH objects for a while: All my Things and Items have been defined in the UI. When I need to delete the existing bridge, will this also delete existing Things and/or Items related to this bridge? I’m asking because I have a ton of Items (for all the valves, etc.) and re-creating them would be horribly painful.

Or, do I just need to create a new bridge and then, in the still existing Gardena irrigation control Thing, I just need to select the new Parent Bridge instead, and everything is fine (and all Items are also still there)?

Ok, by coincident found similar information in a completely different discussion. It’s indeed very simple. Delete the Bridge Thing (the “system account” Thing), re-create it with the same ID and add the Husqvarna API key and secret, done. Nothing else will get deleted and if using the same Thing ID (gardena:account:<ID>), all other Things and Items continue working immediately.