PHPackages                             dalpras/oauth2-gotowebinar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. dalpras/oauth2-gotowebinar

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

dalpras/oauth2-gotowebinar
==========================

LogMeIn GoToWebinar OAuth 2.0 Client Provider for the PHP League's OAuth 2.0 Client

v4.1.1(3mo ago)1244.3k↓30.9%9MITPHPPHP &gt;=8.2.0

Since Jan 31Pushed 3mo ago4 watchersCompare

[ Source](https://github.com/dalpras/oauth2-gotowebinar)[ Packagist](https://packagist.org/packages/dalpras/oauth2-gotowebinar)[ RSS](/packages/dalpras-oauth2-gotowebinar/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (4)Versions (20)Used By (0)

LogMeIn GoToWebinar Provider for OAuth 2.0 Client
=================================================

[](#logmein-gotowebinar-provider-for-oauth-20-client)

This package provides LogMeIn GoToWebinar OAuth 2.0 support for the PHP League's [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client).

Installation
------------

[](#installation)

To install, use composer:

```
composer require dalpras/oauth2-gotowebinar
```

Usage
-----

[](#usage)

Usage is the same as The League's OAuth client, using `\DalPraS\OAuth2\Client\Provider\GotoWebinar` as the provider.

### Authorization Code Flow

[](#authorization-code-flow)

```
$development = true;
$provider = new \DalPraS\OAuth2\Client\Provider\GotoWebinar([
    // The client ID assigned to you by the provider
    'clientId'     => 'your gotowebinar client id',
    // The client ID assigned to you by the provider
    'clientSecret' => 'your gotowebinar client password',
    'redirectUri'  => 'your redirect uri after authorization'
], [
    // optional
    'httpClient' => new \GuzzleHttp\Client([
        // setup some options for using with localhost
        'verify'  => $development ? false : true,
        // timeout connection
        'timeout' => 60
    ])
]);

$redis = new \Redis();
$redis->connect($host, $port);

if (!isset($_GET['code'])) {

    // If we don't have an authorization code then get one
    $authUrl = $provider->getAuthorizationUrl();
    $_SESSION['oauth2state'] = $provider->getState();
    header('Location: '.$authUrl);

    exit;

// Check given state against previously stored one to mitigate CSRF attack
} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {

    unset($_SESSION['oauth2state']);
    exit('Invalid state');

} else {

    // Try to get an access token (using the authorization code grant)
    $token = $provider->getAccessToken('authorization_code', [
        'code' => $_GET['code']
    ]);

    try {
        // We got an access token, let's now get the user's details
        $owner = $provider->getResourceOwner($token);

        // Saved token in redis for future usage.
        $g2wstorage = new \DalPraS\OAuth2\Client\Storage\RedisTokenStorage($redis);
        $g2wstorage->saveToken($accessToken, $owner);

        // Optional: Now you have a token you can look up a users profile data

        // Use these details to create a new profile
        printf('Hello %s!', $owner->getNickname());

    } catch (GotoWebinarProviderException $e) {
        return $e->generateHttpResponse(new \Zend\Diactoros\Response());

    } catch (Exception $e) {

        // Failed to get user details
        exit('Oh dear...');
    }

    // Use this to interact with an API on the users behalf
    echo $token->getToken();
}
```

### Refreshing a token

[](#refreshing-a-token)

```
    $provider = new \DalPraS\OAuth2\Client\Provider\GotoWebinar([
        'clientId'                => 'demoapp',    // The client ID assigned to you by the provider
        'clientSecret'            => 'demopass',   // The client password assigned to you by the provider
        'redirectUri'             => 'http://example.com/your-redirect-url/',
    ]);

    $existingAccessToken = getAccessTokenFromYourDataStore();

    if ($existingAccessToken->hasExpired()) {
        $newAccessToken = $provider->getAccessToken('refresh_token', [
            'refresh_token' => $existingAccessToken->getRefreshToken()
        ]);
        // Purge old access token and store new access token to your data store.
    }
```

### Using GotoWebinar WEB API

[](#using-gotowebinar-web-api)

Interaction with the GoToWebinar API is very easy.

```
    ...

    $provider = new \DalPraS\OAuth2\Client\Provider\GotoWebinar([
        'clientId'                => 'demoapp',    // The client ID assigned to you by the provider
        'clientSecret'            => 'demopass',   // The client password assigned to you by the provider
        'redirectUri'             => 'http://example.com/your-redirect-url/',
    ]);

    // You can get the Resources using a previously stored (in redis) AccessToken
    // The ResourceLoader handle the AccessToken loading for you
    $g2wstorage = new \DalPraS\OAuth2\Client\Storage\RedisTokenStorage($redis);
    $loader = new \DalPraS\OAuth2\Client\Loader\ResourceLoader($g2wstorage, $provider);

    /* @var $resWebinar \DalPraS\OAuth2\Client\Resources\Webinar */
    $resWebinar = $loader->getWebinarResource($organizerKey);

    /* @var $resWebinar \DalPraS\OAuth2\Client\Resources\Webinar */
    $resRegistrant = $loader->getRegistrantResource($organizerKey);

    // ... or if you just had the AccessToken in your hands, instance the Resources needed:
    // $resWebinar = new \DalPraS\OAuth2\Client\Resources\Webinar($provider, $accessToken);
    // $resRegistrant = new \DalPraS\OAuth2\Client\Resources\Registrant($provider, $accessToken);

    try {
        $data = $resWebinar->getWebinarsByOrganizer(new \DateTime('-1 year'), new \DateTime('+1 year'), 0, 10);

        // or
        $data = $resWebinar->getWebinarsByAccount(new \DateTime('-1 year'), new \DateTime('+1 year'), 0, 10);

        // or
        $data = $resWebinar->getWebinar('webinarKey');

        // or
        $data = $resWebinar->deleteWebinar('webinarKey');

        // or
        // helper for changing timezone to utc
        $dateUtcHelper = new \DalPraS\OAuth2\Client\Helper\DateUtcHelper();
        $data =  $resWebinar->createWebinar([
                "subject" => "My first webinar",
                "times" => [[
                    "startTime" => $dateUtcHelper->date2utc(new \DateTime('+1 day')),
                    "endTime" => $dateUtcHelper->date2utc(new \DateTime('+2 days')),
                ]],
            ]);

        // or
        $data = $resRegistrant->getRegistrants('webinarKey');

        // or
        $data = $resRegistrant->getRegistrant('webinarKey', 'registrantKey');

        // or
        $data = $resRegistrant->getRegistrantByEmail('webinarKey', 'myemail@gmail.com');

        // or
        $data = $resRegistrant->createRegistrant('webinarKey', [
                'firstName' => 'Ronnie',
                'lastName' => 'Test',
                'email' => 'test@gmail.com'
            ]);

        // or
        $data = $resRegistrant->deleteRegistrant('webinarKey', 'registrantKey');

        // data is ResultSetInterface = ArrayObject
        return json_encode($data->getArrayCopy());

    } catch (GotoWebinarProviderException $e) {
        // return a psr7 response message (using for example zend\diactoros)
        return $e->generateHttpResponse(new \Zend\Diactoros\Response());

    } catch (\Exception $e) {
        die($e->getMessage());

    }
```

### Using Storage

[](#using-storage)

Storage has been introduced for storing Organizer's accessTokens in a repository (only \\Redis has been implemented).
ResourceLoader use this repository to perform GotoWebinar information access in an easy way. With this feature registrants can subscribe to a course using the accessToken stored by Organizers in the repository.
ResourceLoader manage the data in a centralized way.

```
    $provider = new \DalPraS\OAuth2\Client\Provider\GotoWebinar([
        'clientId'                => 'demoapp',
        'clientSecret'            => 'demopass',
        'redirectUri'             => 'http://example.com/your-redirect-url/'
    ]);

    // Organizers stored their AccessTokens in storage
    $storage = new \DalPraS\OAuth2\Client\Storage\RedisTokenStorage($redisInstance);

    // Connecting ResourceLoader to Storage is possible to retrieve information from multiple organizers
    $resourceLoader = new \DalPraS\OAuth2\Client\Loader\ResourceLoader($storage, $provider);

    // webinars from Organizer 1
    $webinars = $resourceLoader->getWebinarResource($organizerKey1)->getWebinars();

    // registrants from Organizer 2
    $registrants = $resourceLoader->getRegistrantResource($organizerKey2)->getRegistrants($webinarKey);
```

Testing
-------

[](#testing)

```
    ./vendor/bin/phpunit
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/dalpras/oauth2-gotowebinar/blob/master/LICENSE) for more information.

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance79

Regular maintenance activity

Popularity38

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 68.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~150 days

Recently: every ~382 days

Total

18

Last Release

112d ago

Major Versions

v1.5.2 → v2.02020-12-03

v2.0 → v3.02020-12-09

v3.2 → v4.02024-01-30

PHP version history (3 changes)v1.1PHP ~7.2.0

v1.2PHP &gt;=7.2.0

v4.0PHP &gt;=8.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f4ad7c52ee1f0a8936e8bb6bcc95f15d4f55ce63233a0fa629da25bba024bd97?d=identicon)[dalpras](/maintainers/dalpras)

---

Top Contributors

[![dalpras-vimar](https://avatars.githubusercontent.com/u/174025991?v=4)](https://github.com/dalpras-vimar "dalpras-vimar (24 commits)")[![techouse](https://avatars.githubusercontent.com/u/1174328?v=4)](https://github.com/techouse "techouse (8 commits)")[![dalpras](https://avatars.githubusercontent.com/u/11516569?v=4)](https://github.com/dalpras "dalpras (2 commits)")[![markusseyer](https://avatars.githubusercontent.com/u/7557943?v=4)](https://github.com/markusseyer "markusseyer (1 commits)")

---

Tags

clientoauthoauth2authorizationauthorisationGoToWebinarlogmeinlogmeinic

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dalpras-oauth2-gotowebinar/health.svg)

```
[![Health](https://phpackages.com/badges/dalpras-oauth2-gotowebinar/health.svg)](https://phpackages.com/packages/dalpras-oauth2-gotowebinar)
```

###  Alternatives

[stevenmaguire/oauth2-keycloak

Keycloak OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2275.9M27](/packages/stevenmaguire-oauth2-keycloak)[patrickbussmann/oauth2-apple

Sign in with Apple OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1132.5M6](/packages/patrickbussmann-oauth2-apple)[mollie/oauth2-mollie-php

Mollie Provider for OAuth 2.0 Client

251.7M1](/packages/mollie-oauth2-mollie-php)[omines/oauth2-gitlab

GitLab OAuth 2.0 Client Provider for The PHP League OAuth2-Client

36721.5k13](/packages/omines-oauth2-gitlab)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
