# Cannot obtain the Access Token

**URL:** https://devforum.zoom.us/t/cannot-obtain-the-access-token/82649
**Category:** API and Webhooks
**Tags:** pkce-flow, pkce, api
**Created:** [February 6, 2023, 3:07pm UTC](https://devforum.zoom.us/t/cannot-obtain-the-access-token/82649 "2023-02-06T15:07:52Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![david](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@david](https://devforum.zoom.us/u/david)
#### Post date: [February 6, 2023, 3:07pm UTC](https://devforum.zoom.us/t/cannot-obtain-the-access-token/82649/1 "2023-02-06T15:07:52Z")

</div>

I develop a client-side (browser, html/js) web application, which needs to use the ZoomAPI (users, contacts, meetings, etc.). I defined the oAuth private account-level application in the Marketplace. The redirection URL is defined with Ngrok. I successfully pass the Zoom Login and redirected back to my app with the authorization code value as a query string parameter. Anyway, when I’m trying to request access token, I receive various errors, usually 400.

I tried to simulate same call with Postman and it just works! NOTE: The regular oAuth recipe (not PKCE) doesn’t work absolutely both from my code and from Postman as well!

Please pay attention, that what I need:

1. The really working example for client-side oAuth-PKCE flow.
2. Documentation explaining, how to use Zoom API from browser web client-side application, how to pass the auth (1-2-3-…).

Please do not point me to existing documentation and GitHub hosted samples! I have read it already.

Thank you in advance!

---

<div class="post-metadata">

### Author: ![vnkmd](https://avatars.discourse-cdn.com/v4/letter/v/3bc359/32.png) [@vnkmd](https://devforum.zoom.us/u/vnkmd)
#### Post date: [February 6, 2023, 3:12pm UTC](https://devforum.zoom.us/t/cannot-obtain-the-access-token/82649/2 "2023-02-06T15:12:13Z")

</div>

Hi

Is it possible to share the code you use, while hiding the sensitive information?

Thanks

---

<div class="post-metadata">

### Author: ![david](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@david](https://devforum.zoom.us/u/david)
#### Post date: [February 7, 2023, 12:19am UTC](https://devforum.zoom.us/t/cannot-obtain-the-access-token/82649/3 "2023-02-07T00:19:09Z")

</div>

I’ll try to send the code. What do you prefer? Archive? Text? Github? Anyway, I would be appreciated to look the real working example.

---

<div class="post-metadata">

### Author: ![vnkmd](https://avatars.discourse-cdn.com/v4/letter/v/3bc359/32.png) [@vnkmd](https://devforum.zoom.us/u/vnkmd)
#### Post date: [February 7, 2023, 4:11am UTC](https://devforum.zoom.us/t/cannot-obtain-the-access-token/82649/4 "2023-02-07T04:11:51Z")

</div>

You can just post the relevant parts here. What programming language has been used, please?

---

<div class="post-metadata">

### Author: ![david](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@david](https://devforum.zoom.us/u/david)
#### Post date: [February 7, 2023, 3:07pm UTC](https://devforum.zoom.us/t/cannot-obtain-the-access-token/82649/5 "2023-02-07T15:07:08Z")

</div>

TypeScript.

Can you say me, please, is it possible to authenticate the client-side web app without a server? That’s the question.

We have read only access to the certain organizational REST service. The app will be hosted from a CDN. It will be static HTML/JS app powered with Angular or Aurelia framework. The app will embed Zoom Contact Book and should provide the user with ability to invite a member of Zoom Account into on-going meeting directly, without to send an invitation.

---

<div class="post-metadata">

### Author: ![vnkmd](https://avatars.discourse-cdn.com/v4/letter/v/3bc359/32.png) [@vnkmd](https://devforum.zoom.us/u/vnkmd)
#### Post date: [February 7, 2023, 5:34pm UTC](https://devforum.zoom.us/t/cannot-obtain-the-access-token/82649/6 "2023-02-07T17:34:06Z")

</div>

Just to check if I understood you well: you would like to have a web app where:

Different users use the zoom features  
No server authentication is involved

I remember seeing some docs which were purely web only, with embedded code. I don’t know if this can meet your needs. Do have a look

---

<div class="post-metadata">

### Author: ![david](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@david](https://devforum.zoom.us/u/david)
#### Post date: [February 7, 2023, 10:33pm UTC](https://devforum.zoom.us/t/cannot-obtain-the-access-token/82649/7 "2023-02-07T22:33:03Z")

</div>

Yes, I’m talking about the web application, which don’t need to be authenticated on server side, only on client. I need list all users belongs to my account, e.g. I need to be able to call [https://api.zoom.us/v2/users](https://api.zoom.us/v2/users) from my web client directly. OK? The problem is in Zoom oAuth flow. I can pass “authorize” step and obtain a code, but, when I call to /token endpoint, I receive 400 error (bad request):

const authorization = `Basic ${getBase64Token()}`;  
const myHeaders = new Headers();  
myHeaders.append(“Authorization”, authorization);  
myHeaders.append(“Content-Type”, “application/x-www-form-urlencoded”);

fetch(this.config.token\_endpoint, {  
method: ‘POST’,  
body: new URLSearchParams(  
Object.assign(  
{  
grant\_type: ‘authorization\_code’,  
code: q.code,  
client\_id: this.config.client\_id,  
redirect\_uri: this.config.redirect\_uri,  
code\_verifier: this.getCodeVerifier(),  
},  
),  
),  
headers: myHeaders,  
mode: ‘no-cors’  
}).then((response) =\> response.json());

---

<div class="post-metadata">

### Author: ![vnkmd](https://avatars.discourse-cdn.com/v4/letter/v/3bc359/32.png) [@vnkmd](https://devforum.zoom.us/u/vnkmd)
#### Post date: [February 8, 2023, 5:26am UTC](https://devforum.zoom.us/t/cannot-obtain-the-access-token/82649/8 "2023-02-08T05:26:21Z")

</div>

> [@david](#):
>
> getBase64Token()

I am not very familiar with typescript & cannot help you in much detail. I guess getBase64Token() is the issue? What does it return? What does this function do? I guess it is a function similar to a javascript function?

---

<div class="post-metadata">

### Author: ![david](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@david](https://devforum.zoom.us/u/david)
#### Post date: [February 8, 2023, 10:28am UTC](https://devforum.zoom.us/t/cannot-obtain-the-access-token/82649/9 "2023-02-08T10:28:03Z")

</div>

🤦‍♂️ 😯 🙀 🫢 😡

Are you bot or human? Can I talk with human please??? It’s impossible! I can’t waste my time, hour by hour, in that chat and don’t receive an answer.

---

<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: [February 12, 2024, 2:04am UTC](https://devforum.zoom.us/t/cannot-obtain-the-access-token/82649/10 "2024-02-12T02:04:53Z")

</div>

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