# OAuth with PHP: how to convert to base64 correctly

**URL:** <https://devforum.zoom.us/t/oauth-with-php-how-to-convert-to-base64-correctly/21441>\
**Category:** API and Webhooks\
**Created:** [June 16, 2020, 3:14am UTC](https://devforum.zoom.us/t/oauth-with-php-how-to-convert-to-base64-correctly/21441 "2020-06-16T03:14:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cutlernj](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/cutlernj/32/10160_2.png) [@cutlernj](https://devforum.zoom.us/u/cutlernj)\
**Post date:** [June 16, 2020, 3:14am UTC](https://devforum.zoom.us/t/oauth-with-php-how-to-convert-to-base64-correctly/21441/1 "2020-06-16T03:14:31Z")

</div>

Hey there, I’m hoping this is a simple question and answer. I’ve been slogging through the docs on how to setup Oauth (I’ve successfully managed to get JWT working) but when it gets to the part of:

Authorization The string “Basic” with your Client ID and Client Secret with a colon : in between, Base64 Encoded. For example, `Client_ID:Client_Secret`[Base64 Encoded](https://www.base64encode.org/) is `Q2xpZW50X0lEOkNsaWVudF9TZWNyZXQ=` .

I’m finding the docs very vague. There is no part that tells me how to do this. Nothing I’ve tried has worked. Does anyone have a php example of how to setup the correct header for requesting a token?

Thanks!

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [June 18, 2020, 5:45pm UTC](https://devforum.zoom.us/t/oauth-with-php-how-to-convert-to-base64-correctly/21441/2 "2020-06-18T17:45:58Z")

</div>

Hey @cutlernj,

Here is an example I found from the [PHP docs](https://www.php.net/manual/en/function.base64-encode.php):

```php
<?php
$authString = 'Client_ID:Client_Secret';
echo base64_encode($authString);
?>

```

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 10:08pm UTC](https://devforum.zoom.us/t/oauth-with-php-how-to-convert-to-base64-correctly/21441/3 "2020-08-21T22:08:01Z")

</div>

Closed on August 21, 2020, 10:08pm UTC


