The best way is to use Java Script to google login, as I found out.
use
script type="text/javascript"> (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/client.js?onload=onLoadCallback'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(); </script>
to initialize js. Finally, call the login method
function login() { var myParams = { 'clientid' : 'YOUR_CLIENT_ID.apps.googleusercontent.com', //You need to set client id 'cookiepolicy' : 'single_host_origin', 'callback' : 'loginCallback', //callback function 'approvalprompt':'force', 'scope' : 'https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/plus.profile.emails.read' }; gapi.auth.signIn(myParams); }
Using this, I was able to solve this problem. Now the user needs to click on the login to enter the system
Abdullah al noman
source share