Skip to content

OAuth Server 2 Server #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Conversation

AronNovak
Copy link

#2

@AronNovak AronNovak changed the title WIP: OAuth Server 2 Server OAuth Server 2 Server Sep 2, 2022
@AronNovak
Copy link
Author

AronNovak commented Sep 2, 2022

@Skullbock Ready for review.

<?php

require 'vendor/autoload.php';

// @see https://marketplace.zoom.us/docs/guides/build/server-to-server-oauth-app/
$account_id = '...';
$apiKey = "...";
$apiSecret = "...";


// Valid for 1 hour.
$oauth_token = \Weble\Zoom\OAuth::generateToken($apiKey, $apiSecret, $account_id);

$config = \Weble\Zoom\Configuration::getDefaultConfiguration()->setAccessToken($oauth_token);
$apiInstance = new \Weble\Zoom\Api\UsersApi(
    new \GuzzleHttp\Client(),
    $config
);

$users = $apiInstance->users();
print_r($users);

I tested with this and it worked like a charm.

@AronNovak
Copy link
Author

Also as we use it for almost one year in production, we might remove this scary warning that basically makes sure others won't contribute to it :)

@Skullbock
Copy link
Contributor

Hi Aron, great job! i would love to do a couple of more things (if you can help, glad to have your help!):
[ ] Upgrade to min php 7.4 and support 8.0+
[ ] Drop Guzzle dependency, and move to the generic http://httplug.io/ implemenation (which guzzle implements) to allow for different http clients
[ ] Use said client to generate the access token instead of raw http

@AronNovak
Copy link
Author

Upgrade to min php 7.4 and support 8.0+

I'd say here it's out of scope, but for sure it's a logical move.

@Skullbock Skullbock mentioned this pull request Sep 7, 2022
@Skullbock
Copy link
Contributor

@AronNovak if you can, check #4 with the new requirements and some other stuff :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants