Using Gmail authentication within your web application
We have our university web setup to authenticate via ldap.. pretty cool but the good thing about the ldap server is that.. It always went down on saturday night (“Dont dare to think of it as a playboy server”) no its not .. perhaps the system admin is.. but i dont think so. :p . This is for the web of my uni we have a differnt emailing procedure .. which is one of the google provided solution.. “the gmail” now if that ldap server go down. the web go down “not down” the authentication system goes down coouple of days back we had a meeting with the faculty incharge of webmasters in which different issues regarding Khi campus website was discussed after that Hina me and ammar was randomly discussing stuff related to Khi web.. in which certainly ammar popped up with an idea to use gmail authentication at khi.. Great idea as far as i see.
Later that day i googled around for the solution of that gmail related authentication.. There are couple of solution that one can adopt.
1st Study google auth protocol…
If you’re geek go Click Below Immediately.. and get a solution to all your google authentication related stuff.
available here
2nd..
Get an php api… for google authentication rather cool and easy way :p the one i prefer.
require_once("libgmailer.php");
$gmailer = new GMailer();
if ($gmailer->created) {
$gmailer->setLoginInfo($gmail_acc, $gmail_pwd, $my_timezone);
// $gmailer->setProxy("proxy.company.com");
if ($gmailer->connect()) {
// GMailer connected to Gmail successfully.
// Do something with it.
} else {
die("Fail to connect because: ".$gmailer->lastActionStatus());
}
} else {
die("Failed to create GMailer because: ".$gmailer->lastActionStatus());
}
?>
and this is it. you’re done.. logged in…with google accounts
the api documentation is available here
and can be downloaded through sourceforge.
Try it out… worth trying



Did you try it out over KHI, azeem? Did it work?
Yup ammar and it worked.
Can you cook one up for Google Apps?
But its a security flaw to have username and password in this way. If we implement such system in any website, visitors will never provide their credentials.
So, the first one not documented here is always the best one. It will be far more better to consult someone or go through, rather than implementing the second.
However, its a cool way to implement your own website authentication.