# How to determine role value for signature

**URL:** <https://devforum.zoom.us/t/how-to-determine-role-value-for-signature/69170>\
**Category:** Web\
**Created:** [May 18, 2022, 12:08pm UTC](https://devforum.zoom.us/t/how-to-determine-role-value-for-signature/69170 "2022-05-18T12:08:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_maksym](https://avatars.discourse-cdn.com/v4/letter/_/e0b2c6/32.png) [@\_maksym](https://devforum.zoom.us/u/_maksym)\
**Post date:** [May 18, 2022, 12:08pm UTC](https://devforum.zoom.us/t/how-to-determine-role-value-for-signature/69170/1 "2022-05-18T12:08:28Z")

</div>

**Description**  
To generate signature for Meeting Web SDK I must know meeting number and role – 1 or 0, or in another words ‘host’ or ‘participant’.  
The role is crucial, incorrect role can lead to errors while trying to join a meeting, for example ‘Signature is invalid’.

But how exactly to determine the role value is not clear.

The solution I came up with is like this:

1. If user’s personal link is the same as invite link =\> user’s role is host
2. Then I query Zoom /users/me/meetings endpoint, with ‘type’ parameter set to ‘scheduled’. If I find among these meetings the meeting with the same meeting number as the one I extracted from invite link =\> user’s role is host
3. If nothing of the above is true =\> user is participant

But users complain that this is not always enough.

How to determine role value?

**Which App Type?**  
SDK OAuth

**How To Reproduce**  
Steps to reproduce the behavior:

1. User A starts a new meeting with the help of Zoom Desktop application.
2. User A copies invite link and shares it with user B
3. User B authenticates in our custom web application that uses @zoomus/websdk
4. User B sends request (to our custom server) to generate signature with meeting number we extracted from invite link user A gave, and with role 1 (host).
5. User B uses this signature to join the meeting
6. ‘Signature is invalid’

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [May 27, 2022, 10:37pm UTC](https://devforum.zoom.us/t/how-to-determine-role-value-for-signature/69170/2 "2022-05-27T22:37:47Z")

</div>

Hi, @_maksym,

Thank you for posting. One approach you can consider is to decode the signature, the format will be [JSON Web Token](https://marketplace.zoom.us/docs/sdk/native-sdks/auth#generate-the-sdk-jwt),

# Addendum

If using **SDK App type** , debug by [https://jwt.io](https://jwt.io)

# Example signature created with SDK App type:

> eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZGtLZXkiOiJhYmMxMjMiLCJtbiI6IjEyMzQ1Njc4OSIsInJvbGUiOjAsImlhdCI6MTY0NjkzNzU1MywiZXhwIjoxNjQ2OTQ0NzUzLCJhcHBLZXkiOiJhYmMxMjMiLCJ0b2tlbkV4cCI6MTY0Njk0NDc1M30.UcWxbWY-y22wFarBBc9i3lGQuZAsuUpl8GRR8wUah2M

# [jwt.io](https://jwt.io)

 ![E58A916E-347F-41E9-99BD-2BA79AC60C43](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/c/1/c121123fbb4ffc12580418e7afbce3bacb9546d4.png)

In the PAYLOAD section, you can see the values and debug them there.

# \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

If using **JWT App type** , debug by base64decoding it. Here is a helpful forum post you can reference on this topic as well:

> [@Invalid Parameter - signature length error, 0 \< length \< 150](https://devforum.zoom.us/t/invalid-parameter-signature-length-error-0-length-150/36563/5):
>
> Hey @john8, After [base64 decoding](https://www.base64decode.org/) your signature it looks like you are generating it incorrectly: Decoded, it should be in the following format: jwtKey.meetingNumber.expiryTime.role.encryptedJwtSecret Thanks, Tommy

---

<div class="post-metadata">

**Author:** ![\_maksym](https://avatars.discourse-cdn.com/v4/letter/_/e0b2c6/32.png) [@\_maksym](https://devforum.zoom.us/u/_maksym)\
**Post date:** [May 30, 2022, 7:10am UTC](https://devforum.zoom.us/t/how-to-determine-role-value-for-signature/69170/3 "2022-05-30T07:10:23Z")

</div>

HI, @donte.zoom , I know the value of the role in signature, because I generate it. The issue is what role value should I provide in which cases?

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [May 31, 2022, 9:53pm UTC](https://devforum.zoom.us/t/how-to-determine-role-value-for-signature/69170/4 "2022-05-31T21:53:00Z")

</div>

@_maksym,

For the Web SDK, you want to leverage the user role to specify whether the user is a participant or host. For instance, if you want a user to be able to start a meeting, you would want to assign the host role. In short:

→ You want to use the **value `0`** to specify the **participant** role

→ And, You want to use the **value `1`** to specify the **host** role

 ![Screen Shot 2022-05-31 at 5.45.22 PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/1/8/18d83b4f1659b4aa39da73347fd8525334a7c92e.png)

> **[SDK Authorization](https://marketplace.zoom.us/docs/sdk/native-sdks/auth/#generate-the-sdk-jwt)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

---

<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:** [July 1, 2022, 7:53am UTC](https://devforum.zoom.us/t/how-to-determine-role-value-for-signature/69170/5 "2022-07-01T07:53:22Z")

</div>

Closed on July 1, 2022, 7:53am UTC

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