# {"code"=\>124, "message"=\>"Invalid access token."} jwt authentication

**URL:** <https://devforum.zoom.us/t/code-124-message-invalid-access-token-jwt-authentication/91252>\
**Category:** Meetings\
**Tags:** api\
**Created:** [July 4, 2023, 6:18am UTC](https://devforum.zoom.us/t/code-124-message-invalid-access-token-jwt-authentication/91252 "2023-07-04T06:18:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zooma1](https://avatars.discourse-cdn.com/v4/letter/z/7993a0/32.png) [@zooma1](https://devforum.zoom.us/u/zooma1)\
**Post date:** [July 4, 2023, 6:18am UTC](https://devforum.zoom.us/t/code-124-message-invalid-access-token-jwt-authentication/91252/1 "2023-07-04T06:18:35Z")

</div>

**Description**  
_Details on your question, workflow or the problem you’re trying to solve._  
I am getting this error  
{“code”=\>124, “message”=\>“Invalid access token.”}  
anytime i make a request. I am using this zoom library for ruby.

> **[GitHub - kyleboe/zoom\_rb: Ruby REST API Wrapper for zoom.us API](https://github.com/kyleboe/zoom_rb)**
>
> Ruby REST API Wrapper for zoom.us API

we have 2 jwt apps, one for staging and one for production. the one on staging still works. The one on production stopped working in June 27.

Nothing has changed on our end so we don’t know why all of a sudden one of the jwt app stopped working and was return code 124?

Please we need this resolved ASAP because it is currently affecting our business. We debugged this on our end and the conclusion is that this must be an external cause coming from your end. Please advise. Thanks.

**Error?**  
{“code”=\>124, “message”=\>“Invalid access token.”}

**How To Reproduce**

1. $ gem install zoom\_rb

2. require ‘zoom\_rb’ inside irb

3. 

```auto
  Zoom.configure do |c|
    c.api_key = 'xxx'
    c.api_secret = 'xxx'
  end

```

zoom\_client = Zoom.new

1. 

```auto
 zoom_client.user_list

```

5 . the above command in rails console returns this error below.

```auto
{"code"=>124, "message"=>"Invalid access token."}

```

## Additional Context

this is the class that produces the access token in the zoom library we use. It is according to your documentation

```auto
# frozen_string_literal: true
require 'jwt'
require 'logger'

module Zoom
  class Client
    class JWT < Zoom::Client

      def initialize(config)
        ::Logger.new(STDOUT).warn('Zoom::Client::JWT is deprecated. Please use Zoom::Client::ServerToServerOAuth instead. See: https://developers.zoom.us/docs/internal-apps/jwt-faq/')
        Zoom::Params.new(config).require(:api_key, :api_secret)
        config.each { |k, v| instance_variable_set("@#{k}", v) }
        self.class.default_timeout(@timeout || 20)
      end

      def access_token
        ::JWT.encode({ iss: @api_key, exp: Time.now.to_i + @timeout }, @api_secret, 'HS256', { typ: 'JWT' })
      end

    end
  end
end

```

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [July 5, 2023, 2:53pm UTC](https://devforum.zoom.us/t/code-124-message-invalid-access-token-jwt-authentication/91252/2 "2023-07-05T14:53:23Z")

</div>

Hi @zooma1  
Thanks for reaching out to us.

I understand that you are using a JWT app along with the library you shared to generate access tokens, and your production instance stopped working recently.

I would recommend you to try and generate a new access token and try again.  
In the meantime, make sure that you start migrating to our Server to Server Oauth app because our JWT app will be deprecated on September 1, 2023

> **[Internal apps (Server-to-server)](https://developers.zoom.us/docs/internal-apps/)**
>
> 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.
