Can I make Auth0 management api client singleton?

Hello All,
My api authentication token lifetime is big, I want to make the management api client singleton so that I don’t need to generate token every time and initiate management api client for each request.

Now the question is whether management api client is capable or not to make it singleton because, behind the scene, its call http request and I don’t know whether the socket connection keep live for long?

You shouldn’t need to get a new token every time you want to make a request. I am not sure on making it a singleton, but the management client may allow you to store the token, then request a new one when it expires, rather than instantiating a new client for every request. What library/language are you working with?

Let me know,
Dan

Hello Dan, I am using .net nuget packages:
package id=“Auth0.AuthenticationApi” version=“7.0.2” targetFramework=“net462”
package id=“Auth0.Core” version=“7.0.2” targetFramework=“net462”
package id=“Auth0.ManagementApi” version=“7.0.2” targetFramework=“net462”

When the management api life time elapsed, if I want to access any api, it shows

ErrorApiException {“Expired token received for JSON Web Token validation”}.

So at this moment, what to do?

How often are you making these calls? The token is always returning this error?

Also, did you use a quickstart to set up your app? Or a tutorial? If not, could you post your code?