Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Home Assistant Cloud URL used as Redirect URL for OAuth instead of user's configured external URL #56

Open
ScottG489 opened this issue Mar 23, 2022 · 3 comments

Comments

@ScottG489
Copy link

Version of the custom_component

v0.8.3

Configuration

Failure occurs during UI Integration Configuration

Describe the bug

The integration seems to use my Home Assistant Cloud URL (via a Nabu Casa subscription) instead of the external URL that I have configured in Configuration > Settings > General (/config/core). When I am redirected I get sent to a page with this error:

{"status":false,"errorCode":4700,"errorMessage":"Invalid redirect: https://<unique id>.ui.nabu.casa/auth/external/callback","result":null}

I was able to fix this by manually changing the redirect URL parameter in the URL, but I think the external URL that the user specifies in their configuration is what this integration should be using. The installation documentation even specifies that you should use the

...URL you configured inside of Home Assistant as the external URL...

I assume this could also be worked around by specifying the HA Cloud URL for the Redirect URL for OAuth while going through the installation steps.

Debug log

No relevant logs occur

@ScottG489
Copy link
Author

I needed to get verification by my company to get the app approved. After approving it, it turns out that my fix doesn't actually work and I get an error. I think it may be similar to the issue mentioned in #18.

The other workaround I mentioned of adding my HA Cloud URL did seem to work. However, the root cause of this problem still needs to be resolved.

@raman325
Copy link
Owner

that seems like an upstream bug, the cloud URL should be able to get back to your instance and everything should work. Is there a reason why you think or know that the Nabu Casa URL above should not work?

@ScottG489
Copy link
Author

ScottG489 commented May 27, 2022

I think the problem was that the docs say to specify the external URL the user has configured for HA. However, the integration ends up using the Nabu Casa URL which is different. So I feel like the docs should be updated to mention this. What do you think?

I actually also think that the user's specified external URL should be preferred over the Nabu Casa URL. Are you saying this is an upstream bug because HA is giving you the wrong URL to use as the external URL? Because to clarify, that URL does work fine.

I already set up external access to my HA instance before I signed up for Nabu Casa cloud and just generally use my own URL and don't use the Nabu Casa one at all. I just signed up for Nabu Casa cloud to support them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants