How to add OpenID to a php site? - php

I absolutely love StackOverflow's usage of OpenID for registration. How would I go about adding this to my site? It is PHP based. I went to openid.net and looked at the libraries there, but could find little in the way of documentation or examples.

This tutorial was helpful for a previous project I worked on using PHP and OpenID. It has an example app.
http://devzone.zend.com/article/3581
(source: zend.com)

Documentation and examples.

OpenID is great, but have one big disadvantage. Let's imagine that I'm having Google account and Yahoo account. I will login using Google and then I will try to login using Yahoo. And it will be different accounts; it's really difficult to remember what openID provider I was using for registration... So, be careful with OpenID on entertainment websites, but it is still ok for developers websites.
Check OpenId class from Zend Framework.

Related

How can Google account credentials by applied to my PHP app (SSO)?

I have a PHP application that will be accessed by users who are already
signed into Google ( the app runs in an iFrame on a Google Site that
requires Google login)
What is the best SSO approach that uses Google login, so users have
the same identity in both places?
Best to use a some OpenID opensource? .. zend/cake/symf plugin?
GoogleApps infrastructure? .. or a identity service like Janrain?
Is it too early to go with OpenID Connect? etc.
Thanks much.
OpenID works well - and indeed, is good enough for StackOverflow - you probably used it to register your account here.
There's an article called Getting Started with OpenID. Although it's on Zend's website, it doesn't seem to be tied to the Zend framework, so is a good starting point. It covers all the modules you need to download, and includes an example to help get you started.
Also take a look on simplesamlphp and its integration with Google:
Setting up a simpleSAMLphp SAML 2.0 IdP to use with Google Apps
Is an open source project based on php. Nice comunity and complete documentation.
Hi again I recently discovered this interesting project HybridAuth, an SSO PHP Library for authentication through identity providers like Facebook, Twitter, Google, Yahoo, LinkedIn, MySpace, Windows Live, Tumblr, Identica, LastFM, OpenID, PayPal, Vimeo, Foursquare, AOL, Viadeo, and others.
I didnt test it but seems also a good solution.

How to discover OpenID IDP, then authenticate with OpenID Provider in PHP

I've been looking at implementing OpenID authentication to one of my websites and want to find the best possible solution to make it as easy as possible for users to sign up / in.
Through my long searches on Google I found a few sites that have already covered this in quite a bit of detail; Usability Research on Federated Login written by Google, so feel that they are pretty trustworthy design patterns for a best use scenario.
Now in coming to implement this I have found very little PHP support for logins that are done in this manner; the user only has to type in an email address and all of the OpenID details are found automagically. It should also be compatible with Google Apps addresses.
Google provided a link to a great example of this in action http://www.puffypoodles.com/lso2 but although its source code is available to download, it's written in Java, which I'm far from familiar with!
So I was wondering if anyone had found a good PHP implementation that functioned in this manner. php-openid seems too bloated, lightopenid looks great, but doesn't support this functionality.
Thanks
I'd just like to point out that LightOpenID now comes with an example provider script you might use as a base.

How to authenticate a user with Google gmail account like stackoverflow

I want to authenticate a user using Google account. I had developed oauth using some libraries.
But it is giving me a message like some website is asking permission to access google docs/calendar/etc.,.
When we are logging into stackoverflow.com it is asking stackoverflow.com is accessing you#gmail.com. How can i get a permission for email address.
Update: I developed oauth using Zend PHP library.
And see the screenshots
stackexchange.com
My application screenshot
Thank You
At the moment, I'm working on example ZF 1.11 application that uses OpenID and openid-selector. The ZF application, called zfopenid, can be downloaded from here (it contains full ZF library and it should work out of the box):
Authentication with google, yahoo works (at least for me) at this stage. To make it work I needed to make some changes in Zend_OpenId_Consumer described at http://framework.zend.com/issues/browse/ZF-6905 + some additional changes. Also I incorporated My_OpenId_Extension_AttributeExchange (i.e. AttributeExchange implementation by Chris Bisnett) to fetch email from google, yahoo (at the moment it is not displayed, but it should be in $_GET variable returned from google, yahoo, aol or myopenid to user/login).
So, if you or anyone would like to test it, I would be grateful as I'm planning to eventually write a blog post about this. Any feedback would be very helpful at this stage. Specifically, whether it really works, or it just works for me (I'm running it on localhost using XAMPP for Linux 1.7.3a and Linux Mint 10).
I did some experiment with ZF to create OPEN ID login form , but i case of google , i was able to sign in but i wasn't able to ask google for the user info
because google is implementing openid extension called AX as i remember , while ZF implement only SREG , you can find it in library/Zend/OpenId/Extension
here is my demo example http://zc.dagho.com/index/login , its working very nice with google and others but it can't ask for users info
and you can take alook to : How to get OpenID user Profile info?
Google implements AX as well as Yahoo
(you have to request permission from
yahoo). Unfortunately Zend Framework
OpenID only supports SREG at the time
of this writing but I've written an
extension for AX support here as well
ak33m.com/?p=71 – Akeem Oct 29 '09 at
2:27
http://framework.zend.com/issues/browse/ZF-6905
update : this might be good , i didn't test it :
http://framework.zend.com/issues/browse/ZF-7328
I believe Stackoverflow uses the http://www.dotnetopenauth.net/ library.
https://meta.stackexchange.com/questions/56109/stack-overflow-and-dotnetopenauth
you can authenticate users using google open id as in stackoverflow login.

Use Google Apps for Site Login?

Hey all,
I'm redesigning the infrastructure for a website, and I want to make the login system use the accounts on our Google Apps. How would I be able to do something like this? I'm using PHP for the backend.
Thanks for any help.
-Trey
OAuth is one way, but it might be easier to implement OpenID, which is already provided by Google Apps. See Google Apps domain as OpenID provider
Take a look at the Google Login PHP class. It is no longer under active development and there is no support provided for it, but it should give you something to work off of. Also be sure to look Google Federated Login as a reference.

Integrating openid authenticiation into a php application

I want to integrate openid authentication into my php application. It must support authentication from yahoo, google, aol, msn/hotmail/live (not sure if its support openid).
I have tried searching google and have been able to come up with anything useful. I will really appreciate advises and links to good tutorials.
Thanks in anticipation.
This looks like a pretty solid tutorial covering the Google part.
Googling for 'php openid implementation tutorial' yields lots of relevant links.
Good luck!
Take a look at Janrain Engage. With the free version you can choose 6 different providers.
EDIT:
They provide an single API for authentication using OpenID and other authentication methods. Services like Twitter, Facebook and Windows Live don't use OpenID but some other method (i.e. Twitter uses something based on OAuth). Instead of implementing every method yourself you can use one single unified API.

Categories