get_oauth_token.php does not result in refresh token... redirects to homepage... no error #2645
Replies: 2 comments 9 replies
-
Code to reproduce is: `<?php /** PHPMailer - PHP email creation and transport class. Get an OAuth2 token from an OAuth2 provider. /** Aliases for League Provider Classes Select Provider: $providerName = ''; if (array_key_exists('provider', $_GET)) { //These details are obtained by setting up an app in the Google developer console, //If this automatic URL doesn't work, set it yourself manually to the URL of this script $params = [ $options = []; switch ($providerName) { if (null === $provider) { if (!isset($_GET['code'])) { |
Beta Was this translation helpful? Give feedback.
-
Worth checking first whether the $redirectUri you specified in your script (above) is EXACTLY the same as the one specified to the Google console. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am trying to use PHPMailer get_oauth_token.php to enable XOAUTH2 authorization for gmail in Open Journal System (OJS) software published by PKP. As guided here at https://github.com/PHPMailer/PHPMailer/wiki/Using-Gmail-with-XOAUTH2 , I followed all the steps and when I run the vendor/phpmailer/phpmailer/get_oauth_token.php in browser and complete the subsequent steps fo selecting provider (google) then sign in, then allow user consent, it results in redirection to homepage and does not display the refresh token. No error is showing in browser or error log. I am unable to figure out what is going wrong. I have ask the OJS PKP support, and they said I should ask PHPMailer support.
Please help me to resolve this issue. Thanks in anticipation.
Beta Was this translation helpful? Give feedback.
All reactions