-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
get_oauth_token.php does not result in refresh token... redirects to homepage... no error, #2646
Comments
Code to reproduce is: `<?php /**
/**
namespace PHPMailer\PHPMailer; /**
if (!isset($_GET['code']) && !isset($_GET['provider'])) { Yahoo Microsoft/Outlook/Hotmail/Live/Office365 //require 'vendor/autoload.php'; require '/home/username/public_html/subdomain/lib/pkp/lib/vendor/autoload.php'; session_start(); $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'])) { |
It's quite likely your app will refuse to serve a file directly from a vendor folder, which should not normally be inside the web root. This might manifest as serving your home page, so perhaps copy this script to the web root and adjust the callback URL to match. |
Thanks Synchro! the normal directory path of get_oauth_token.php is public_html/lib/pkp/lib/vendor/phpmailer/phpmailer/get_oauth_token.php in Open Journal Systems (OJS). We did not modified it in original.
I have copied the get_oauth_token.php to public_html/OJS_installation_folder. and then modified the $redirectUri to as following: Looking forward to more guidance on it. |
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.
Originally posted by @mohsincheema in #2645
The text was updated successfully, but these errors were encountered: