jaroschek / home-assistant-myuplink

Custom Home Assistant integration for devices and sensors in myUplink account.
39 stars 8 forks source link

Error "Sorry, there was an error : invalid_request" Request Id: 0HN0BLIQDNJIF:00000001 #52

Open woodex1981 opened 5 months ago

woodex1981 commented 5 months ago

Hello,

Getting the error in https://api.myuplink.com/oauth/error?errorId= when trying to authorize integration:

Error Sorry, there was an error : invalid_request Request Id: 0HN0BLIQDNJIF:00000001

What might be an issue???

Screenshot from 2024-01-07 16-58-48

Siggy101 commented 5 months ago

I have the same error:

image

nytafar commented 5 months ago

I have the same error, I will pause setup awaiting developments. Appreciate the effort.

jaroschek commented 5 months ago

Did you provide the correct callback url https://my.home-assistant.io/redirect/oauth when creating the application in dev.myuplink.com?

We had this problem here discussed before. See https://github.com/jaroschek/home-assistant-myuplink/issues/9, https://github.com/jaroschek/home-assistant-myuplink/issues/30, https://github.com/jaroschek/home-assistant-myuplink/issues/32, https://github.com/jaroschek/home-assistant-myuplink/issues/39

As you can not alter the callback url in an already existing application, you will have to create a new application with the correct callback url https://my.home-assistant.io/redirect/oauth

I have to mention the following issue too: https://github.com/jaroschek/home-assistant-myuplink/issues/31#issuecomment-1776734853

I noticed a problem with an already authorized integration where the authorization did not work any more. I was forced to create a new application in dev.myuplink.com and re-authorize the application (after deleting th previous application credentials).

Siggy101 commented 5 months ago

Thanks for the pointers. I had customised the callback URL to use the URL of my own installation. It looks like that was my mistake. I misunderstood the instructions. You actually have to use https://my.home-assistant.io/redirect/oauth, not https://myowncustomurl.com/redirect/oauth

It is also important to then remove the credentials by reading the instructions (!): "You can delete the old credentials stored in Home Assistant by going to the Devices & Services page, clicking the three dots top right and selecting "Application Credentials". Delete the one originating from myuplink, and you'll be prompted for new credentials next time you set up the integration."

Thanks for the support. all is working for me now.

woodex1981 commented 5 months ago

Thanks, that was it "You actually have to use https://my.home-assistant.io/redirect/oauth, not https://myowncustomurl.com/redirect/oauth"

Siggy101 commented 5 months ago

Thanks, that was it "You actually have to use https://my.home-assistant.io/redirect/oauth, not https://myowncustomurl.com/redirect/oauth"

Looks like we both made the same mistake there. Our brains interpreted the instructions the same way... D'oh!