Email validation issue with myOpenID / EAUT PHP library

3 views
Skip to first unread message

victorc

unread,
Aug 21, 2008, 12:03:40 PM8/21/08
to Email Address to URL Transform (EAUT)
Hi,

I have a problem, perhaps a simple one :

On my Web site I implement EAUT PHP library and when I use an email
address associated to a myOpenID account, I have the following error
on the myOpenID Web site :
"myOpenID is not authorized to verify that "http://emailtoid.net/
mapper/?email=toto%40gmail.com" is your identifier."

My code is :
$openid_url = Auth_Yadis_Email_getID("to...@gmail.com");
and then $openid_url variable contains "http://emailtoid.net/mapper/?
email=toto%40gmail.com"

I have checked on Magnolia and I can connect with my to...@gmail.com
email (and so with my myOpenID URL).
On EAUT.org it works http://eaut.org/example/?email=toto%40gmail.com
And on my Web site I can connect with another email address creating a
EmailtoID OpenID URL.

So where is my mistake ?
Do I have to encode or decode the return URL string from
Auth_Yadis_Email_getID ?
What is the Magnolia trick for this ?

Thanks for help and answer.
Victor

Jesse Clark

unread,
Aug 21, 2008, 12:46:59 PM8/21/08
to ea...@googlegroups.com
Hi,

When using a mapper endpoint you need to perform an http get to the
mapper url which should provide you a redirect that contains the
open_id in the location header.

You can browse the Ruby on Rails plugin we use on Ma.gnolia here:
http://code.google.com/p/eaut/source/browse/#svn/code/rails/trunk/
acts_as_eaut/lib/acts

-Jesse

victorc

unread,
Aug 22, 2008, 4:12:37 AM8/22/08
to Email Address to URL Transform (EAUT)
Thanks Jesse for your answer,

So I have to manually, into my PHP code, get the myopenid URL given by
my Emailtoid URL, right ?
I have missed this step, I was thinking that Emailtoid did that
(http://emailtoid.net/developers/#adding_emailtoid)

Victor

On 21 août, 18:46, Jesse Clark <je...@jesseclark.com> wrote:
> Hi,
>
> When using a mapper endpoint you need to perform an http get to the  
> mapper url which should provide you a redirect that contains the  
> open_id in the location header.
>
> You can browse the Ruby on Rails plugin we use on Ma.gnolia here:http://code.google.com/p/eaut/source/browse/#svn/code/rails/trunk/
> acts_as_eaut/lib/acts
>
> -Jesse
>
> On Aug 21, 2008, at 9:03 AM, victorc wrote:
>
>
>
> > Hi,
>
> > I have a problem, perhaps a simple one :
>
> > On my Web site I implement EAUT PHP library and when I use an email
> > address associated to a myOpenID account, I have the following error
> > on the myOpenID Web site :
> > "myOpenID is not authorized to verify that "http://emailtoid.net/
> > mapper/?email=toto%40gmail.com" is your identifier."
>
> > My code is :
> > $openid_url = Auth_Yadis_Email_getID("t...@gmail.com");
> > and then $openid_url variable contains "http://emailtoid.net/mapper/?
> > email=toto%40gmail.com"
>
> > I have checked on Magnolia and I can connect with my t...@gmail.com
> > email (and so with my myOpenID URL).
> > On EAUT.org it workshttp://eaut.org/example/?email=toto%40gmail.com

victorc

unread,
Aug 23, 2008, 8:42:37 AM8/23/08
to Email Address to URL Transform (EAUT)
Hi,

Just to let you know that it works in PHP with :

$openid_url =
Auth_Yadis_Email_getID($_POST['openid_identifier']);
$ch = curl_init($openid_url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$output = curl_exec($ch);
curl_close($ch);
preg_match_all('/Location: (.*)/', $output,
$arropenid,PREG_PATTERN_ORDER);
$openid_url=$arropenid[1][0];

So now with Web iste use OpenID and also the Emailtoid service,
great !

Victor

Will Norris

unread,
Aug 23, 2008, 1:05:45 PM8/23/08
to ea...@googlegroups.com

On Aug 23, 2008, at 5:42 AM, victorc wrote:

>
> Hi,
>
> Just to let you know that it works in PHP with :
>
> $openid_url =
> Auth_Yadis_Email_getID($_POST['openid_identifier']);
> $ch = curl_init($openid_url);
> curl_setopt($ch, CURLOPT_HEADER, 1);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
> $output = curl_exec($ch);
> curl_close($ch);
> preg_match_all('/Location: (.*)/', $output,
> $arropenid,PREG_PATTERN_ORDER);
> $openid_url=$arropenid[1][0];
>
> So now with Web iste use OpenID and also the Emailtoid service,
> great !


Actually you don't need to do all of that curl stuff. When
normalizing the URL[0], these redirects will be followed and the final
URL will be used as the claimed OpenID. Even if you're just doing
XRDS-Simple discovery for a non-OpenID service, it also requires that
the consumer follow redirects[1]. Unless you just want to know what
they URL is (and I'd love to hear the use case), you don't need to
resolve the redirects yourself. The PHP code sample[3] should work as
written.

[0]: http://openid.net/specs/openid-authentication-2_0.html#normalization
[1]: http://xrds-simple.net/core/1.0/#anchor6
[2]: http://eaut.org/code/

victorc

unread,
Aug 23, 2008, 5:48:40 PM8/23/08
to Email Address to URL Transform (EAUT)
Hi,

Thanks for your answer, I understand but if I don't do this
redirection myself it seems that the Emailtoid service has some
difficulty to valide the OpenID URL associated to my email.

My email in Emailtoid is associated to a myOpenID OpenID URL but then
this url can not be validated by myOpenID. From myOpenID Web site, I
have the answer :
"myOpenID is not authorized to verify that "http://emailtoid.net/i/
60098fbe/78e1598f/" is your identifier."

It is why I have decided to myself retrieve the real myOpenID OpenID
URL from the Emailtoid service.

Is it make sense ?

Victor
Reply all
Reply to author
Forward
0 new messages