OH3 Rest Api token forever valid?

Hello, I read that the API token is only valid for a hour. Is there already a solution available for a token which is valid until it’s deleted? I have some python scripts which are updating some values via the rest API.

You can generate own tokens in your user settings which will last longer.

1 Like

Cool thanks is there anywhere an example how to use the. Oauth2 with openhab? @Confectrician

1 Like

I know @Spaceman_Spiff has used it with HABApp

@Bruce_Osborne @Confectrician

So this call in my python script is correct?

  headers = {'Content-type': 'text/plain', 'Accept': 'text/plain', "Authorization": "[token]"}
  e = requests.post('http://localhost:8080/rest/items/number_BME280_humidity/', humidity_string, headers=headers)

Sorry for python i have to pass.