geoffreylagaisse / Hass-Microsoft-Graph

Microsoft Graph API Presence Integration for Home Assistant
29 stars 3 forks source link

issue with redirect link #7

Closed ayed3 closed 2 years ago

ayed3 commented 2 years ago

I did everything as mentioned in the instructions and when I reach external link to authenticate my access I get the below error message from Microsoft that there is mismatch

is there any changes required in the microsoft graph files in home assistant?

The redirect URI 'https://my.home-assistant.io/redirect/oauth' specified in the request does not match the redirect URIs configured for the application '-----'. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal. Navigate to https://aka.ms/redirectUriMismatchError to learn more about how to fix this.

geoffreylagaisse commented 2 years ago

Hi,

Within azure the redirect uri below must match with your hass environment. Is your environment reachable from the internet?

For Redirect URI, add: https:///auth/external/callback

image
ayed3 commented 2 years ago

yes it is reachable from internet using duckdns

integration once I put add ID and secret ID it takes me to external link that has wrong home assistant address "default address' the below error massage that I get which has wrong address of my home assistant external link

error message: The redirect URI 'https://my.home-assistant.io/redirect/oauth' specified in the request does not match the redirect URIs configured for the application

geoffreylagaisse commented 2 years ago

I have the same error on my dev machine, something must have changed in the last Hass update. I will investigate! Thanks for letting me know

geoffreylagaisse commented 2 years ago

@ayed3 I have updated the docs, you need to add the 'https://my.home-assistant.io/redirect/oauth' to the redirect URL's in azure. Home-assistant added a security step before your instance...

ayed3 commented 2 years ago

thanks for your support, I have updated the azure with the above link and what happend is that the integration will take me external link which is https://my.home-assistant.io/ and gives me error "account linking rejected" as the below

Account linking rejected Linking your account will grant your Home Assistant instance access to your account. All credentials are stored locally.

geoffreylagaisse commented 2 years ago

You are not receiving the options as shown here?

image
ayed3 commented 2 years ago

I get this window after getting the response that linking is rejected , I have updated the page with the duckdns link and tried again and yet it get rejected

I am running 2022.7.3

I think that https://my.home-assistant.io/ this page is not passing the right info to azure

ayed3 commented 2 years ago

Closed it by mistake 😔

geoffreylagaisse commented 2 years ago

Can you try it in a private browser maybe? I know the my.home-assistant.io has persistent cookies

ayed3 commented 2 years ago

I did it now in inPrivate mode and it seems that it works as it get me to external page and once I finalize authentication on Azur it sent me back to integration page but unfortunately it gives me error

I feel not lucky at all

is there anything needs to be changed in this page?

DC31B5A5-5AEB-4FD3-99A0-54FDD73E8BED
ayed3 commented 2 years ago

any good news

theovencook commented 2 years ago

I've had the same issues as you,

I believe you need to tick 'Access tokens' and 'ID tokens'.

Also make sure you have the secret copied correct, see https://github.com/geoffreylagaisse/Hass-Microsoft-Graph/issues/5

ayed3 commented 2 years ago

I've had the same issues as you,

I believe you need to tick 'Access tokens' and 'ID tokens'.

Also make sure you have the secret copied correct, see #5

thanks a lot to you @theovencook , now it is working and special thanks goes to creator of this integration @geoffreylagaisse

ayed3 commented 2 years ago

it is working now thanks

geoffreylagaisse commented 2 years ago

@ayed3 glad somebody could help you, I didn't have to check the boxes. @theovencook opened a pullrequest with the updated readme and this information! Thanks! But @jlweston did most of the heavy lifting, I only maintain it