# TPC/sessionName Bug?

**URL:** <https://devforum.zoom.us/t/tpc-sessionname-bug/45863>\
**Category:** Android\
**Created:** [March 17, 2021, 2:34am UTC](https://devforum.zoom.us/t/tpc-sessionname-bug/45863 "2021-03-17T02:34:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![hung](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hung/32/22250_2.png) [@hung](https://devforum.zoom.us/u/hung)\
**Post date:** [March 17, 2021, 2:34am UTC](https://devforum.zoom.us/t/tpc-sessionname-bug/45863/1 "2021-03-17T02:34:17Z")

</div>

**Description**  
Get onError callback 7 when using certain tpc/sessionNames

Customizable Desktop SDK v.1.0.1

**To Reproduce**

1. Try authenticating into a session on Android Instant Zoom SDK through the normal process (audio on, video off), except use string “03/16/21\_” as the tpc/sessionName.
2. Get (only) onError callback with code 7 despite Initialize & JoinSesssion reporting success

**Additional Info**

- Simply changing tpc/sessionName to “\_Default” works as expected (no errors, all proper callbacks.)
- Adding the two special characters “/_" to my userName field (ie "Username/_” with tpc="\_Default") give no issues, so it isn’t something with strings generally.
- Replacing “/” with “\_” fixes it, so it seems “/” is a special char for the tpc/sessionName field for Android Instant Zoom SDK?

Can someone confirm that it’s a bug with the SDK and not something I’m doing wrong? FYI I am using the exact same string for both JWT’s tpc field and JoinSession’s sessionName argument.

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [March 17, 2021, 5:55pm UTC](https://devforum.zoom.us/t/tpc-sessionname-bug/45863/2 "2021-03-17T17:55:08Z")

</div>

Hi @hung, thanks for bringing this to our attention.

I believe this has to do with how the JWT is encoding the `/` character. We will investigate this and let you know once we have more information. It’s either a bug, or we have a lapse in our documentation surrounding the requirements for a session’s `tpc` value. Either way, we apologize for the inconvenience and will be sure to give you an update ASAP.

Thanks!

---

<div class="post-metadata">

**Author:** ![hung](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hung/32/22250_2.png) [@hung](https://devforum.zoom.us/u/hung)\
**Post date:** [March 17, 2021, 8:23pm UTC](https://devforum.zoom.us/t/tpc-sessionname-bug/45863/3 "2021-03-17T20:23:30Z")

</div>

Thanks for the reply. I forgot to mention, but the exact same setup works with the Windows Instant SDK (with `tpc=“03/16/21\_”), so the issue could be platform-specific (I did not/cannot test on other platforms’ SDKs.)

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [March 17, 2021, 9:00pm UTC](https://devforum.zoom.us/t/tpc-sessionname-bug/45863/4 "2021-03-17T21:00:05Z")

</div>

Hi @hung,

Thanks for the additional information. This has been consistent with our internal findings, so this is really a matter of determining which platform is doing things correctly. 🙂

Thanks!

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [March 18, 2021, 10:55pm UTC](https://devforum.zoom.us/t/tpc-sessionname-bug/45863/5 "2021-03-18T22:55:36Z")

</div>

Hi @hung,

It turns out that this is actually not a bug with the SDK and you can properly use `/` characters in your `tpc` value. If you are using the `JWTUtil` class, when encoding the payload, the `Base64.URL_SAFE` flag is replacing `/` with `_`. Removing this flag from the `encodeToString` call will resolve the issue.

Thanks!

---

<div class="post-metadata">

**Author:** ![hung](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hung/32/22250_2.png) [@hung](https://devforum.zoom.us/u/hung)\
**Post date:** [March 19, 2021, 11:35pm UTC](https://devforum.zoom.us/t/tpc-sessionname-bug/45863/6 "2021-03-19T23:35:07Z")

</div>

Hi, thanks for the feedback! That might be part of the problem-- but I am generating my JWT token from the same source for both Windows and Android, and not using (as far as I can tell) the `JWTUtil` class.

I also remember checking the tokens generated by both Android & Windows, and they were correct. I verified with a generic base64encoder to confirm:  
You can use this ([https://www.base64encode.org/](https://www.base64encode.org/)) to see that the string `03/16/21_` encode/decodes correctly with no loss of data (even with “safe” checked), since the replace happens after encoding and before decoding ([here](https://github.com/jwt-dotnet/jwt/blob/main/src/JWT/JwtBase64UrlEncoder.cs)’s the exact implementation of the encoder I’m using.)

Happy to be proven wrong, but my guess is that there’s still a bug in how `tpc` is parsed on Android.

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [March 22, 2021, 6:22pm UTC](https://devforum.zoom.us/t/tpc-sessionname-bug/45863/7 "2021-03-22T18:22:01Z")

</div>

Hi @hung,

Thank you for the additional information. After generating the JWT in [jwt.io](http://jwt.io), I was able to reproduce this issue, confirming your suspicions. We will let you know as soon as we have any updates around this investigation.

Thanks!

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [March 24, 2021, 7:39pm UTC](https://devforum.zoom.us/t/tpc-sessionname-bug/45863/8 "2021-03-24T19:39:18Z")

</div>

Hi @hung,

After looking into this internally, we have determined that the behavior on Android is correct. We are working on updating the logic on our other platforms to match this and will update our documentation as well.

Thanks!

---

<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:** [April 24, 2021, 5:39am UTC](https://devforum.zoom.us/t/tpc-sessionname-bug/45863/9 "2021-04-24T05:39:23Z")

</div>

Closed on April 24, 2021, 5:39am UTC

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