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

Add support to switch to secret token and to validate webhook #67

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

raman325
Copy link
Owner

@raman325 raman325 commented Apr 1, 2023

This PR is in progress - this hasn't been tested yet but theoretically you could set up a new config entry with the latest code changes and things should work fully. It's still missing a clean transition for existing configurations but that is in progress.

If this PR doesn't work for you, please share errors and logs so I can iterate on this more quickly, and if you are impatient, see #64 for a possible interim solution

Fixes #65
Fixes #63

@raman325 raman325 force-pushed the secret_token branch 2 times, most recently from 4bc092b to f6402fc Compare April 1, 2023 18:29
@Normanras
Copy link
Contributor

@raman325 I was able to test this out briefly today. The good news is that I get through the config process without any issues by using the secret token. The only thing I have to debug was that after restarting HA after the initial config, the sensor wouldn't pick up any change in status making me think the webhook wasn't being validated as expected.

After 15 minutes, the sensor still showed no changes in the last 15 minutes. Restarting HA pushed any updates to status, and then it would repeat the long duration of no state changes. I'd like to try a few other things out, so I'll keep you updated if anything comes up.

Config worked though and I received no errors connecting to my Zoom app with the secret token.

@raman325
Copy link
Owner Author

thanks for confirming, I was seeing similar behavior but couldn't figure out why it would happen like that. Why would status updates work sometimes but not others? I must have implemented something incorrectly but haven't been able to track down what it is

@ev0rtex
Copy link

ev0rtex commented Jun 23, 2023

I've been waiting on this change for a bit and finally decided to just update mine to use this PR today. The good news is that it works great! It should especially work well for someone setting it up from scratch without any previous config.

The only issues I ran into were my own fault from messing around with it so much... I had previously tried setting up an entry for the integration that was doomed to never work with the current code on the master branch. I think HA must have saved the credentials off from my configuration.yaml rather than using the secret_token I changed it to after recreating my Zoom app. Only after watching the webhook requests with wireshark I realized that it was trying to use a different (previous) secret_token than I had in my configuration.yaml. After deleting the entry and then adding again everything worked great and I was able to validate the event callback in Zoom's app marketplace finally.

@Normanras
Copy link
Contributor

@ev0rtex That's super helpful and also fairly interesting because I also noticed that after installing the PR custom_component HA tried recreating the app with the old creds. The only way to "reset" it was to do a series of HA Restarts between each change. Basically: install PR branch > restart > install integration > restart etc etc. It was tedious, but it was also the only way that my install experience was that of a brand new install.

As for the "no change in status" issue that me and @raman325 experienced, what I found even more odd is that after clearing the dev branch and bringing HA back to normal with the master branch, the same behavior happened that the status wouldn't update in HA.

I ended up solving this by regenerating the client secret and verification token. After re-installing with those new keys, everything was updating as expected.

That could be a Zoom issue, but I'd have to look into it. I should have also paid attention to if in HA the sensors attribute: id was changed upon each install or if that's a static user id.

I'll try to do some more testing today, possibly with a complete sandbox of HA to see if any of the above reproduces itself.

@Normanras
Copy link
Contributor

Can confirm it worked as expected today. Changing the status and everything and various states in Zoom correctly communicated back with Home Assistant. The additional data in the logs (meeting started, etc) also was correctly communicated.

Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.7.4 to 3.8.5.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/v3.8.5/CHANGES.rst)
- [Commits](aio-libs/aiohttp@v3.7.4...v3.8.5)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@ggaltqq
Copy link

ggaltqq commented Nov 12, 2023

Haven't tried it before, but version from this branch works fine for me. Verification passed, trigger and events looks good.

@raman325
Copy link
Owner Author

thank you all for confirming. I need to clean this up a bit and then I can release it. Thanks for testing!

@DJPoulter
Copy link

Hey @raman325 Don't know if you are still working on this but one thing is that when I try to add another zoom entry it won't let me input any of the information and goes straight to the callback url. I need to setup 2 zoom accounts for going into home assistant

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

Successfully merging this pull request may close these issues.

URL validation failed. Try again later. Integration is using deprecated DEVICE_CLASS_* constants
5 participants