# Implementing client secret validation

**URL:** <https://devforum.zoom.us/t/implementing-client-secret-validation/83375>\
**Category:** API and Webhooks\
**Tags:** webhooks\
**Created:** [February 19, 2023, 11:14am UTC](https://devforum.zoom.us/t/implementing-client-secret-validation/83375 "2023-02-19T11:14:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomeriko](https://avatars.discourse-cdn.com/v4/letter/t/f4b2a3/32.png) [@tomeriko](https://devforum.zoom.us/u/tomeriko)\
**Post date:** [February 19, 2023, 11:14am UTC](https://devforum.zoom.us/t/implementing-client-secret-validation/83375/1 "2023-02-19T11:14:05Z")

</div>

```
"""
print("timestamp", timestamp)
print("body", body)
message = f"v0:{timestamp}:{json.dumps(body)}"
print("!!!message", message)
return hmac.new(bytes(ZOOM_WEBHOOK_SECRET_TOKEN, 'utf-8'), bytes(message, 'utf-8'), hashlib.sha256).hexdigest()

```

def validate\_webhook\_challenge(request):  
“”"  
Handle a Zoom webhook challenge request.  
“”"  
print(“request”, request)  
if request[‘httpMethod’] == “POST”:  
request\_data = json.loads(request[‘body’])  
if “event” in request\_data and request\_data[“event”] == “endpoint.url\_validation”:  
print(“request\_data”, request\_data)  
plain\_token = request\_data[“payload”][“plainToken”]  
hashed\_token = generate\_signature(request[‘headers’][“x-zm-request-timestamp”], request\_data)  
response\_data = {  
“plainToken”: plain\_token,  
“encryptedToken”: hashed\_token  
}  
print(“response\_data”, response\_data)  
return json.dumps(response\_data) #, 200, {“Content-Type”: “application/json”}  
return “”, 200

— response is:  
“{"plainToken": "y7v\_f12AQa6pS0BG6TlnqQ", "encryptedToken": "f7e37e9aba1d4033c92134ae71d7d22b9ebfae69109c9dc056847c462a0b9623"}”

I also tried without json.dumps in the end.

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [February 28, 2023, 6:48pm UTC](https://devforum.zoom.us/t/implementing-client-secret-validation/83375/2 "2023-02-28T18:48:54Z")

</div>

Hi @tomeriko  
Thanks for reaching out to the Zoom Developer Forum.  
Have you been able to troubleshoot this error or do you still need assistance?

---

<div class="post-metadata">

**Author:** ![tomeriko](https://avatars.discourse-cdn.com/v4/letter/t/f4b2a3/32.png) [@tomeriko](https://devforum.zoom.us/u/tomeriko)\
**Post date:** [February 28, 2023, 8:05pm UTC](https://devforum.zoom.us/t/implementing-client-secret-validation/83375/3 "2023-02-28T20:05:30Z")

</div>

Hi  
I still need assistance. What is the exact format Zoom expects?  
Do you have some sample code in python?

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [March 1, 2023, 3:58pm UTC](https://devforum.zoom.us/t/implementing-client-secret-validation/83375/4 "2023-03-01T15:58:08Z")

</div>

Hi @tomeriko  
Unfortunately, we do not have a sample app in python.

Here is the sample app that is available

> **[GitHub - zoom/webhook-sample-node.js: Receive Zoom Webhooks](https://github.com/zoom/webhook-sample-node.js)**
>
> Receive Zoom Webhooks. Contribute to zoom/webhook-sample-node.js development by creating an account on GitHub.

Hope this helps,  
Elisa

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [August 9, 2024, 12:47pm UTC](https://devforum.zoom.us/t/implementing-client-secret-validation/83375/7 "2024-08-09T12:47:35Z")

</div>

This topic was automatically closed 368 days after the last reply. New replies are no longer allowed.
