From 2f8a4a99cc3014904225339896dc80811c05f485 Mon Sep 17 00:00:00 2001 From: JonasLudwig1998 <146742086+JonasLudwig1998@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:27:29 +0200 Subject: [PATCH] Implementing new GoTo token retrieval process (#47) * Implementing new authentication process, but not finished yet * updating information in readme file * Mini layout change --- EventListener/IntegrationRequestSubscriber.php | 2 +- Integration/GoToAbstractIntegration.php | 9 +++++++-- README.md | 8 ++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/EventListener/IntegrationRequestSubscriber.php b/EventListener/IntegrationRequestSubscriber.php index 674bd8a..4e98dbf 100644 --- a/EventListener/IntegrationRequestSubscriber.php +++ b/EventListener/IntegrationRequestSubscriber.php @@ -28,7 +28,7 @@ public static function getSubscribedEvents(): array */ public function getParameters(PluginIntegrationRequestEvent $requestEvent): void { - if (str_contains($requestEvent->getUrl(), 'oauth/v2/token')) { + if (str_contains($requestEvent->getUrl(), 'oauth/token')) { $authorization = $this->getAuthorization($requestEvent->getParameters()); $requestEvent->setHeaders([ 'Authorization' => sprintf('Basic %s', base64_encode($authorization)), diff --git a/Integration/GoToAbstractIntegration.php b/Integration/GoToAbstractIntegration.php index 634014d..ac291e6 100644 --- a/Integration/GoToAbstractIntegration.php +++ b/Integration/GoToAbstractIntegration.php @@ -105,12 +105,17 @@ public function getApiUrl(): string return 'https://api.getgo.com'; } + public function getAuthBaseUrl(): string + { + return 'https://authentication.logmeininc.com'; + } + /** * {@inheritdoc} */ public function getAccessTokenUrl(): string { - return $this->getApiUrl().'/oauth/v2/token'; + return $this->getAuthBaseUrl().'/oauth/token'; } /** @@ -118,7 +123,7 @@ public function getAccessTokenUrl(): string */ public function getAuthenticationUrl(): string { - return $this->getApiUrl().'/oauth/v2/authorize'; + return $this->getAuthBaseUrl().'/oauth/authorize'; } /** diff --git a/README.md b/README.md index 4c07de0..d6684be 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,9 @@ We have given the GoTo plugin (for GoToWebinar / GoToMeeting / GoToAssist / GoTo * Download the plugin, say to you home directory, e.g. using wget, and prepare it cd ~ - wget https://github.com/Leuchtfeuer/mautic-goto-bundle/archive/master.zip - unzip master.zip - mv mautic-goto-bundle-master LeuchtfeuerGoToBundle + wget https://github.com/Leuchtfeuer/mautic-goto-bundle/archive/[required-branch].zip + unzip [zip-filename].zip + mv [filename] LeuchtfeuerGoToBundle * copy plugin to the Mautic installation @@ -60,7 +60,7 @@ We have given the GoTo plugin (for GoToWebinar / GoToMeeting / GoToAssist / GoTo ## Apply Authorization * Paste Client ID and Client Secret into the plugin settings in Mautic -* Now click "Authorize App", log in to GoToWebinar (if requested), and confirm +* Now click "Authorize App", log in to GoToWebinar (if requested), and confirm (it might be necessary to enable pop-ups and redirects in your browser for this step to work) ## Set up Syncing * Try a first manual Sync: