A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2009 yearHow do I implement Direct Identity based OpenID authentication with Zend OpenID - page 1
User InfoPosts
How do I implement Direct Identity based OpenID authentication with Zend OpenID#1
I(m using the Zend framework and the openid selector from http://code.google.com/p/openid-selector/ - however I find I can(t login using sites like Google and Yahoo as they use direct identity based login system whereby one is just redirected to a url as opposed to entering a unique url of their own for authentication.

I(ve checked out many options and hacks but none of them seem to work. How can i get this to work here btw - how is it implemented at stack overflow? I could really use all the help here guys..



Edit

Well the issue here is that from what I have noticed is that the Zend OpenID class doesn(t support OpenID 2.0 the thing is that a typical open ID providor gives you a unique url such as your-name.openid-providor.com or openid-providor.com/your-name and the Zend OpenId class just parses through that url and then redirects you to the providor website where upon authentication you are redirected back.

In the case of Yahoo and google - you don(t enter a unique url instead you are redirected to the providors login site and upon login and authentication you are redirected back - so basically whats happeining is that the zend_openID object when it parses to tell who the providor is it fails to tell from the general url itself. Like when you click on teh Google link it redirects you to https://www.google.com/accounts/o8/id

Its more an issue with the zend openid object here and there isn(t any help on zend related forums - so I was wondering if someone had already hacked or had an alteration I could make to the class to accomplish this. Sorry if I(m missing something but I(m kinda new to this and programming with open ID and have just started to get my feet wet.



Thanks for the follow up - I did check into RPX a while back and they do have a php class but I wasnt able to check it out plus I really just want to for now get the code selector used as on stackoverflow to work with Yahoo and Google authentication. There has to be some kind of way to tweak the parsing which the Zend OpenID class uses as it runs a series of regular expression checks to make a discovery.

posted date: 2009-04-11 22:08:00


Re: How do I implement Direct Identity based OpenID authentication with Zend OpenID#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2009-04-11 22:08:01


Re: How do I implement Direct Identity based OpenID authentication with Zend OpenID#3
Did you check out the manual -- Zend_OpenId_Consumer basics? Check out 38.2.2 on that page and let me know if this helps, because it should.Specifically, I don(t know if Google offers OpenID. I know that Yahoo worked because I(ve tried it a while back.

posted date: 2009-04-12 06:13:00


Re: How do I implement Direct Identity based OpenID authentication with Zend OpenID#4
Actually I am using this very piece of code in the manual as it is. However its not working with google and Yahoo at all. I've tried some hacks online but they don't work :( how has stack overflow accomplished this btw?

posted date: 2009-04-13 21:37:00


Re: How do I implement Direct Identity based OpenID authentication with Zend OpenID#5
@Ali Stackoverflow is build on asp.net (I think). Anyway, I'd suggest you supply more info, e.g. your code, your error message -- then I could try to help. Or you post on the fw-general@ mailing list.

posted date: 2009-04-14 03:26:00


Re: How do I implement Direct Identity based OpenID authentication with Zend OpenID#6
I(m dealing with similar issues. I(m planning on using RPX now with Zend Framework. Maybe I(ll write an adapter. Just to let you know.Info: (RPS now( provides an all-in-one interface and UI for user registration withfacebookGoogleYahoomySpaceIDWindows LiveIDOpenIDaol

posted date: 2009-04-14 23:03:00


Re: How do I implement Direct Identity based OpenID authentication with Zend OpenID#7
Google doesn't provide openID, Google has their own GoogleID, which can be associated with openIDs.

posted date: 2009-04-14 23:05:00


Re: How do I implement Direct Identity based OpenID authentication with Zend OpenID#8
I(m pretty sure that Yahoo only works with OpenID 2.0. If you want to support Yahoo users, you(re going to have to upgrade to a library with 2.0 support. That(s going to be a matter of more than tweaking some parsing.

posted date: 2009-04-15 00:09:00


Re: How do I implement Direct Identity based OpenID authentication with Zend OpenID#9
Going over all the advice provided - I(ve decided to ditch using the zend_openid class [ sorry about that zend ] and instead I(ve switched to using JanRains OpenID library. Its taken a few hours to get it up and running with my project but atleast its working like a breeze. Had to make a lot of hacking and a bit of code spill over to get it working but its worth it.I couldn(t use any of Zend adapters with Zend-Auth to settle this new code library in as the library did the authentication on its own. SO I hacked and made a generic adapter that just returned a filled zend_result set to the Auth object thus I authenticate using my library and merely store the result in the Auth object pulling a bit of a fast one one the Zend-Auth object rather than have to rewrite my code again.The library is available at http://openidenabled.com/php-openid/Thanks for all the help guys.

posted date: 2009-04-16 04:20:00


Re: How do I implement Direct Identity based OpenID authentication with Zend OpenID#10
Thanks for the information. I started by using JanRain(s library, but I have problems with getting Simple Registration to work: I have not succeeded in getting any data that way. And there is no documentation on using Attribute Exchange. :(So, I found and was trying Zend/OpenId, but had the same problem as you: no Yahoo!, Google and who knows what else support. Reading this, it seems I(ll have to get back to JanRain; RPX is not an option in my case as it(s a third party service.

posted date: 2009-05-02 08:33:00


Re: How do I implement Direct Identity based OpenID authentication with Zend OpenID#11
Little late to the game but I was able to get this working with some hacks I found around the interwebs.First. Yahoo. To get Yahoo working all I had to do was change the JavaScript to use me.yahoo.com instead of just yahoo.com and it worked perfectly with the version of the Zend Framework I(m using. Unfortunately Google still wasn(t, so some hacking was in order.All of these changes go in Zend/OpenId/Consumer.phpFirst, in the _discovery method add the following on the series of preg_match checks that starts at around line 740.} else if (preg_match((/<URI>([^<]+)<\/URI>/i(, $response, $r)) { $version = 2.0; $server = $r[1];I added this right before the return false; statement that(s in the else {} block.Second, in the _checkId method you(ll need to add 3 new blocks (I haven(t dug around enough to know what causes each of these three cases to be called, so I covered all to be on the safe side.Inside the $version <= 2.0 block, you(ll find an if/else if/else block. In the first if statement ($this->_session !== null) add this to the end:if ($server == (https://www.google.com/accounts/o8/ud() { $this->_session->identity = (http://specs.openid.net/auth/2.0/identifier_select(; $this->_session->claimed_id = (http://specs.openid.net/auth/2.0/identifier_select(;}In the else if (defined((SID() block add this to the end:if ($server == (https://www.google.com/accounts/o8/ud() { $_SESSION[(zend_openid(][(identity(] = (http://specs.openid.net/auth/2.0/identifier_select(; $_SESSION[(zend_openid(][(claimed_id(] = (http://specs.openid.net/auth/2.0/identifier_select(;}And then after the else block (so outside the if/else if/else block all together, but still inside the $version <= 2.0 block) add this:if ($server == (https://www.google.com/accounts/o8/ud() { $params[(openid.identity(] = (http://specs.openid.net/auth/2.0/identifier_select(; $params[(openid.claimed_id(] = (http://specs.openid.net/auth/2.0/identifier_select(;}Link to the bug in Zend Framework Issue Tracker

posted date: 2009-05-09 15:45:00


Re: How do I implement Direct Identity based OpenID authentication with Zend OpenID#12
Pretty late - but again thanks for the tip would bookmark this definitely for any other project - for now I've meticulously tweaked and integrated the JanRain library into my code. Thanks for the info ;)

posted date: 2009-05-10 00:49:00


select page: « 1 2 »
Copyright ©2008-2017 www.momige.com, all rights reserved.