Get a new access token using a refresh token

I this possible on hass.io? I have a valid refresh token and following the dev doc but I still get “unsupported_grant_type”.

Any ideas, or how this is supposed to work? thanks.

(this is a test with postman for example)

grant type
Is probably Bearer
Have a look at this
https://requests-oauthlib.readthedocs.io/en/latest/oauth2_workflow.html

1 Like

this is the dev doc i’m refering to but it isn’t working for me, not sure if it’s home assistant only and not hass.io

grant_type=refresh_token&
refresh_token=IJKLMNOPQRST&
client_id=https%3A%2F%2Fhass-auth-demo.glitch.me

From your Postman screenshot it appears you are passing the parameters in the query string and not the body. Try this:

  • Switch to the Body tab
  • Select the x-www-form-urlencoded option
  • Enter the parameters in the KEY and VALUE columns - you can do this more quickly by:
    • Click on Bulk Edit
    • Enter the parameters in for format name:value, one per line
    • Click on Key-Value Edit
  • Remove the querystring parameters
1 Like

bingo! thanks I really appreciate your help with this @Steven_Rollason

I’m using the browser hassConnection object for my extension, and as it always runs in the content of the user having the brower open I didn’t want to deal with long lived access tokens, though I may try websockets for my next extension.