Gmail automatic login script
I have the gmail开发者_JAVA百科 login credintals. Is it possible to login automatically to Gmail if we pass the username and password through url or by CURL.
If you rightclick the gmail login page and view source you can find the id's of the user email and login fields.
You can then use these to write a javascript to fill it automatically and submit.
Theres an implementation here you might check http://techtoggle.com/2009/06/how-to-autologin-into-yahoo-hotmail-lycos-mail/
Edit: its not using the languages you mentioned but its a solution all the same. Also, while the link url and article title dont mention gmail there is a gmail version of the javascript on the page
You can use the Gmail IMAP interface to access all your mails. Retrieve Your Gmail Emails Using PHP and IMAP - details the process with code examples.
if you have already gmail login go to developer login and use google apis
step 1 ) use google client id,
step 2) g-signin2 this div should call,
finally use below code,
<html>
<head>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id" content="783587177326-gtl5gpje4riio2ho6qnsfainp4a1mf5o.apps.googleusercontent.com">
</head>
<body>
<div class="g-signin2" data-onsuccess="onSignIn"></div>
</body>
</html>
<script>
function onSignIn(googleUser) {
var profile = googleUser.getBasicProfile();
console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
console.log('Name: ' + profile.getName());
console.log('Image URL: ' + profile.getImageUrl());
console.log('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present.
}
</script>
精彩评论