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?
Ammar said this on October 27, 2007 at 8:02 pm |
Yup ammar and it worked.
Azeem said this on October 28, 2007 at 12:22 pm |
Can you cook one up for Google Apps?
koaster said this on April 11, 2008 at 4:49 am |
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.
OneManWarmy said this on April 22, 2009 at 5:12 pm |
i have some doubts can u add me on gmail
rajgoel123@gmail.com
rajat said this on March 10, 2010 at 4:15 pm |
Deprecated: Call-time pass-by-reference has been depre
sandeep said this on May 21, 2011 at 7:18 am |
Your posts are very useful. But the text is hard to read. Font-size is so small.
Quang said this on November 1, 2011 at 11:56 pm |
Hi !!!
I want the same. I am trying to login into gmail rom my own application. In my application there is a link and my username and password stored in database and retrieve from db. I want to login into gmail with given userid and password. I tried Your Example but its not works or me.
It showing error like
Deprecated: Call-time pass-by-reference has been deprecated
in libgmailer.php
Please can you give solution for me. It will be really helpfull to me.
Please post me ,
sanjoy09@hotmail.com
Thanks in Advance,
Sanjay said this on March 18, 2012 at 6:25 pm |
Excellent Tutorial .
Tariq said this on May 28, 2012 at 5:30 pm |
I will like you to help me with my email address! Its says authintication required
Charles said this on October 18, 2012 at 4:14 pm |
i am getting error like this:
Deprecated: Call-time pass-by-reference has been deprecated
in libgmailer.php
Please give solution.
kds7ap@gmail.com
Thanks in Advance buddy..
kds7ap said this on November 30, 2012 at 10:28 am |