webex/webex-js-sdk

Unable to register, User has excessive device registrations

guillaumepotier opened this issue ยท 9 comments

Hi there,

While developing on the js sdk, I encountered this error. What is exactly the device registrations limit, how it works?

Thanks for your help

Hello - maximum device registrations is 750. This is effectively any place a token is generated for a user, which can be integrations, actual devices or teams logins. Typically if a maximum is reached, an application has gone into a loop or similar and generated too many tokens.

Hi @judupree thanks for your answer! To be more clear, this is 750 simultaneous valid token? I'm using Guest JWT token generation, with 12hours expiration date, maybe this is too long.

That being ask, does that means that I cannot have confcalls with more than 750 simultaneous users within the SDK?

Thanks again for your help

Best

That would be 750 tokens per user, not per app. One possible scenario would be a user logging in to a Webex Teams integration; that integration has incorrect logic built in to constantly refresh their access token; since each access token has an expiration date of 14 days, if the app refreshes the token every 5 minutes (just as an example), they'd max out their total amount of "live" tokens quickly.

Guest users shouldn't impact the max token value, as those function as independent applications vs tokens tied to a specific user.

Hum, make more sense.

So with this piece of code below I use, I notice now that every user uses the same jwt token for "John Doe" user. Despite the exp date being set 6 hours later, I might have generated too many tokens within the last 24 hours.. That makes sense, I'll generate random users on application boot then.

const header = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(JSON.stringify({
  alg: "HS256",
  typ: "JWT"
})));
const payload = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(JSON.stringify({
  sub: "1234567890",
  name: "John Doe",
  iss: token,
  exp: `${moment().add(6, 'hours').unix()}`
})));

const signature = CryptoJS.HmacSHA256(`${header}.${payload}`, CryptoJS.enc.Base64.parse(secret));
const jwt = `${header}.${payload}.${CryptoJS.enc.Base64.stringify(signature)}`;

Thanks a bunch for your help, much appreciated

Happy to help! If you have any further issues that aren't bug reports or pull requests against the SDK, we are available via devsupport@webex.com as well; you'll typically get quicker answers going directly there.

Awesome! ;) I might bother you there with #1561 then ;)
I'm quite stocked by your SDK and documentation (and now support), was not the same some years (months?) ago.
Best

@judupree
Hi, I've met the same issue with my user account. After reviewing the code, I found the Bug in my code. The unregister() function is not called when the program is closed.
As a result, the upper limit of device registration is finally reached.
My question is, is there any way to get my account back to normal? It has been reporting this mistake for two days. As a result, my account can no longer be tested.

@ck123pm After a few hours you should be able to connect again.

You can also try releasing some tokens here:

https://idbroker.webex.com/idb/profile#/tokens

Make sure to log in with the user that is currently blocked.