arjenbos / ha-postnl

Custom PostNL Home Assistant integration
Apache License 2.0
31 stars 2 forks source link

Add instructions on how to get the oauth url without the use of a browser extension #6

Open FeikoJoosten opened 11 months ago

FeikoJoosten commented 11 months ago

Hi there,

I noticed you stated that you need to use the browser extension to get sent back to home assistant for the oauth callback. While it does make it a lot easier, you don't need to install the extension either.

If you open the browser console after having logged into post nl, you'll see an error that it couldn't launch an application. It also states the oauth url required. Manually copying that url, replacing the postnl://login section with https://my.home-assistant.io/redirect/oauth allows you to manually navigate to the newly formatted url. This is then caught by home assistant and the integration successfully installs. Alternatively, you can also enable the networking recorder and catch the oauth url that way. But I don't have example screenshots at hand for that.

Here are some example screenshots. First login to post nl image

After loggin in you get this blank page image

Open the browser console and find the url image

Copy the url and replace the postnl://login section as stated before. Then manually navigate to the new url.

arjenbos commented 11 months ago

Hi @FeikoJoosten,

I am quite aware of this method; however, explaining this route isn't easy for someone who is not very tech-savvy. That's why I used that statement. People who understand how OAuth2 works are generally more tech-savvy and will likely be able to follow your approach.

Nevertheless, I am curious why you opened this issue. Do you want to add this approach to the documentation as well?

FeikoJoosten commented 11 months ago

I would indeed like to see this approach be documented as well. I initially didn't want to add this integration because of the browser extension requirement. After checking the code I saw that all it did was replace a section of an url so I wasn't too bothered by it. But as you're also saying, someone who is not very tech-savvy (or can't read code) won't get that far.

Additionally someone on a Discord I'm in stated they couldn't install the extension either. (This was before you added instruction for installing the extension on different browsers). So I explained how they could use this approach instead.

malosaa commented 11 months ago

I did test the browser extension on Brave with 0 issue's Just unpacked the files, enabled developer mode and imported the code, and works as expected.

Just strange that it won't work for other people, as i did do the same for my other clients. Like chrome and Mozilla.

IIIdefconIII commented 9 months ago

The steps i took \custom_components\postnl: https://github.com/iMicknl/python-postnl-api Browser Extention: https://github.com/arjenbos/ha-postnl Card \www of www\community\postnl-card\: https://github.com/peternijssen/lovelace-postnl-card/tree/0.12.2

Extra info: https://community.home-assistant.io/t/lovelace-postnl/112433

arjenbos commented 9 months ago

@IIIdefconIII Are you aware that you're using a completely different Github repo than this one?

FeikoJoosten commented 9 months ago

I also don't see how it adds value to the issue itself haha.

IIIdefconIII commented 9 months ago

@IIIdefconIII Are you aware that you're using a completely different Github repo than this one?

yeah i couldnt get it to work yesterday so alot of information got fired on me and those steps actuall got the card and stuff going

IIIdefconIII commented 9 months ago

@IIIdefconIII Are you aware that you're using a completely different Github repo than this one?

how do you mean? image

FeikoJoosten commented 9 months ago

how do you mean?

You mentioned

\custom_components\postnl: https://github.com/iMicknl/python-postnl-api

In your initial message. Which is a different repository from this one.

IIIdefconIII commented 9 months ago

how do you mean?

You mentioned

\custom_components\postnl: https://github.com/iMicknl/python-postnl-api

In your initial message. Which is a different repository from this one.

i see, why not merge together?