Java API call using JWT token returns 401

Description
I am trying to implement Java API using JWT to call create meetings.
Used jwt.io Java library to generate a token in Java code. Token gets generated and validated through jwt.io just to make sure that I have created the right token. However, when I pass that token in API call as Bearer , it returns 401 HTTP response in JAVA API response. If I try to use the same token in postman, it returns code “124”.
If I use a token code generated through the Zoom platform inside the app works fine in postman and code.

Error
Receiving HTTP Response 401 in HTTP connection response.
Receiving below JSON in postman if using JWT created through JWT library:
{
“code”: 124,
“message”: “Invalid access token.”
}

Which App?
JWT

Hey @baljit.karwal,

Please see my post here:

Thanks,
Will

1 Like

Thanks @will.zoom, I will try this today and keep you posted.

It worked when I passed “iss” as “api_key” in my claims to JWT.
Below simple JWT create worked to create valid token using “https://github.com/auth0/java-jwt”:
JWT.create().withClaim(“iss”, apiKey).withClaim(“exp”, tokenExpiryTimestamp).sign(algorithm);

Thanks
Baljit

Hey @baljit.karwal,

I’m glad this did the trick! :100:

Best,
Will

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