# Gardena oauth2 and redirect

**URL:** <https://discourse.nodered.org/t/gardena-oauth2-and-redirect/64859>\
**Category:** General\
**Created:** [8 July 2022 20:20 UTC](https://discourse.nodered.org/t/gardena-oauth2-and-redirect/64859 "2022-07-08T20:20:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomasvjohansen](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thomasvjohansen/32/32779_2.png) [@thomasvjohansen](https://discourse.nodered.org/u/thomasvjohansen)\
**Post date:** [8 July 2022 20:20 UTC](https://discourse.nodered.org/t/gardena-oauth2-and-redirect/64859/1 "2022-07-08T20:20:07Z")

</div>

Hi Im trying to get oauth2 to communicate with the gardena api, using this flow: [chmuck’s gists · GitHub](https://gist.github.com/chmuck)

I keep getting error 400.  
I ran gardena's test terminal on my nodered pi and it could get a token, so there is working autorized communication to gardena api.

```auto
curl -X POST -d "grant_type=client_credentials&client_id=xxxxxxxxxxxxxx&client_secret=xxxxxxxxxxxxx"
https://api.authentication.husqvarnagroup.dev/v1/oauth2/token

```

so it must be something with oauth2 node not working.

But Im not very familiar with oauth2 and dont know about the redirect url I have to setup in the gardena api.  
Does the redirect url point to my public ip, and I then have to open a port for it to point internal to nodered? or is it something in the nodered I have to setup?

Anyone who can point me in the right direction?

basically I just want it to park my "smart" mower when it starts to rain 😉

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [6 September 2022 20:20 UTC](https://discourse.nodered.org/t/gardena-oauth2-and-redirect/64859/2 "2022-09-06T20:20:43Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
