FAQ
I've only just started looking at OpenID, and would love to integrate
it with Catalyst apps. Using
Catalyst::Authentication::Credential::OpenID I've got the basics of
Authentication working, but I'm having problems with SREG.

The first problem is when using a .conf config, the docs say you can use:
<extension_args>
http://openid.net/extensions/sreg/1.1
required email
optional fullname,nickname,timezone
</extension_args>

However, this fails, since this doesn't resolve into an Array, which
is what Net::OpenID::Consumer expects when
Catalyst::Authentication::Credential::OpenID calls set_extension_args.

Ok, so I can get around that by defining my Auth in my Perl module instead...

The next problem is I can't seem to get at the SREG hash. I'm trying
to get the hash using:

$sreg = $c->user->signed_extension_fields(
'http://openid.net/extensions/sreg/1.1'
);

...but this just assigns $sreg the string
'http://openid.net/extensions/sreg/1.1'.

Dumps of $c->user don't show anything useful either.

Am I missing something, or is OpenID Extensions for Catalyst currently broken?

--
Trevor Phillips - http://dortamur.livejournal.com/
"On nights such as this, evil deeds are done. And good deeds, of
course. But mostly evil, on the whole."
-- (Terry Pratchett, Wyrd Sisters)

Search Discussions

  • Ashley Pond V at Jul 4, 2009 at 6:01 am

    On Jul 3, 2009, at 9:13 PM, Trevor Phillips wrote:
    Catalyst::Authentication::Credential::OpenID I've got the basics of
    Authentication working, but I'm having problems with SREG.

    The first problem is when using a .conf config, the docs say you
    can use:
    <extension_args>
    http://openid.net/extensions/sreg/1.1
    required email
    optional fullname,nickname,timezone
    </extension_args>

    However, this fails, since this doesn't resolve into an Array, which
    is what Net::OpenID::Consumer expects when
    Catalyst::Authentication::Credential::OpenID calls set_extension_args.

    Ok, so I can get around that by defining my Auth in my Perl module
    instead...

    The next problem is I can't seem to get at the SREG hash. I'm trying
    to get the hash using:

    $sreg = $c->user->signed_extension_fields(
    'http://openid.net/extensions/sreg/1.1'
    );

    ...but this just assigns $sreg the string
    'http://openid.net/extensions/sreg/1.1'.

    Dumps of $c->user don't show anything useful either.

    Am I missing something, or is OpenID Extensions for Catalyst
    currently broken?
    The configuration examples are bad. Menno Blom provided the patch to
    support the stuff and I documented it incorrectly. I'm really sorry
    about this; it's been this way for a long time. I've been trying just
    this week to get a new release but I was also trying to run deeper
    tests to make sure I don't make another faux pas and I've been having
    problems getting them together and LWPx::ParanoidAgent is still
    broken and my excuse machine is on the fritz.

    The snippet below (unedited, it's better to not use the config->{} =
    assignment idiom) is from a recent report from Orlando Vazquez who
    got it running in spite of the bad doc. There was also an issue with
    Config::General being a PITA regarding the data structure so you
    might want to start with a pure Perl config and if it runs, then put
    it into your favored config file format.

    -Ashley
    __PACKAGE__->config->{Plugin::Authentication} = {
    use_session => 1,
    default_realm => 'openid',
    realms => {
    openid => {
    credential => {
    class => 'OpenID',
    store => {
    class => 'OpenID'
    }
    },
    ### need this to get registration fields
    extensions => {
    'http://openid.net/extensions/sreg/1.1' => 1
    },
    extension_args => [
    'http://openid.net/extensions/sreg/1.1',
    {
    required => 'email,timezone',
    optional => 'fullname,nickname,timezone'
    }
    ]
    }
    }
    };
  • Trevor Phillips at Jul 4, 2009 at 9:43 am
    On Sat, Jul 4, 2009 at 2:02 PM, Ashleywrote:
    The configuration examples are bad. Menno Blom provided the patch to support
    the stuff and I documented it incorrectly. I'm really sorry about this; it's
    been this way for a long time. I've been trying just this week to get a new
    release but I was also trying to run deeper tests to make sure I don't make
    another faux pas and I've been having problems getting them together and
    LWPx::ParanoidAgent is still broken and my excuse machine is on the fritz.
    Thanks. I'm surprised there isn't more interest in maturing the OpenID
    support. I think it has a lot of potential for easing registration &
    authentication for a lot of web apps.

    Are you referring to LWPx::ParanoidAgent exploding when a bad Identity
    URL is given? I tried using eval to get around it but that seems to
    clash with the rest of the workings of your library.
    The snippet below (unedited, it's better to not use the config->{} =
    assignment idiom) is from a recent report from Orlando Vazquez who got it
    running in spite of the bad doc. There was also an issue with
    Config::General being a PITA regarding the data structure so you might want
    to start with a pure Perl config and if it runs, then put it into your
    favored config file format.
    [snip]
    ? ? ? ? ? ? ### need this to get registration fields
    ? ? ? ? ? ? extensions => {
    ? ? ? ? ? ? ? ?'http://openid.net/extensions/sreg/1.1' => 1
    ? ? ? ? ? ? },
    This was the missing link! I can now chuck this in my test app:
    $c->stash->{sreg} =
    $c->user->extensions->{'http://openid.net/extensions/sreg/1.1'};
    ...and access sreg properties from the templates. Yay!

    Disappointingly, it looks like many providers don't offer SREG details
    - Google, Yahoo, LiveJournal didn't return anything. MyOpenID did
    though.

    Ideally, I'd like to store a local profile for a user, using OpenID
    for Auth, and SREG for initial/default field population when
    available. I'd rather use a ID and username created & tracked
    internally, though, and just use the OpenID for auth.

    --
    Trevor Phillips - http://dortamur.livejournal.com/
    "On nights such as this, evil deeds are done. And good deeds, of
    course. But mostly evil, on the whole."
    -- (Terry Pratchett, Wyrd Sisters)
  • Ashley Pond V at Jul 4, 2009 at 3:47 pm

    On Jul 4, 2009, at 2:43 AM, Trevor Phillips wrote:
    Are you referring to LWPx::ParanoidAgent exploding when a bad Identity
    URL is given? I tried using eval to get around it but that seems to
    clash with the rest of the workings of your library.
    No, the LWP debug clash. It's not that important but it will cause
    any installation to fail if it has a new LWP and I think ParanoidAgent
    is really the only one to use in production. Brad did an update on it
    last week but it didn't include removing the deprecated LWP hooks.

    I have mixed feelings about the exception throwing behavior I put in.
    All the authentication plugins fail silently except mine but OpenID
    is a drag to debug so I felt like it was necessary. I've meant to
    get with t0m and the list to discuss a better failure mechanism. I'll
    probably just make it noisy in the log and stop the error throwing.

    -Ashley
  • Trevor Phillips at Jul 6, 2009 at 5:52 am

    On Sat, Jul 4, 2009 at 5:43 PM, Trevor Phillipswrote:

    Disappointingly, it looks like many providers don't offer SREG details
    - Google, Yahoo, LiveJournal didn't return anything. MyOpenID did
    though.
    Doing a bit more reading, it looks like Google won't support SREG, but
    are supporting AX, which seems to be the way places are going. Does
    the current Catalyst OpenID Auth support AX?

    Fudging the format for the SREG query, I tried:

    extensions => {
    'http://openid.net/srv/ax/1.0' => 1
    },
    extension_args => [
    'http://openid.net/srv/ax/1.0',
    {
    required => 'email',
    'type.email' => 'http://schema.openid.net/contact/email'
    }
    ]

    ...but got nothing back from the providers I tried.

    --
    Trevor Phillips - http://dortamur.livejournal.com/
    "On nights such as this, evil deeds are done. And good deeds, of
    course. But mostly evil, on the whole."
    -- (Terry Pratchett, Wyrd Sisters)
  • Edmund von der Burg at Jan 9, 2010 at 1:15 am

    2009/7/6 Trevor Phillips <trevor.phillips@gmail.com>:
    Doing a bit more reading, it looks like Google won't support SREG, but
    are supporting AX, which seems to be the way places are going. Does
    the current Catalyst OpenID Auth support AX?

    Fudging the format for the SREG query, I tried:

    ? ? ? ? ? ? ? extensions => {
    ? ? ? ? ? ? ? ? ?'http://openid.net/srv/ax/1.0' => 1
    ? ? ? ? ? ? ? },
    ? ? ? ? ? ? ? extension_args => [
    ? ? ? ? ? ? ? ? ? ? ?'http://openid.net/srv/ax/1.0',
    ? ? ? ? ? ? ? ? ? ? ?{
    ? ? ? ? ? ? ? ? ? ? ? required => 'email',
    ? ? ? ? ? ? ? ? ? ? ? 'type.email' => 'http://schema.openid.net/contact/email'
    ? ? ? ? ? ? ? ? ? ? ?}
    ? ? ? ? ? ? ? ? ?]

    ...but got nothing back from the providers I tried.
    Indeed - Google are super picky :)

    You'll need the 'mode' parameter too:

    'http://openid.net/srv/ax/1.0' => {
    required => 'email',
    mode => 'fetch_request',
    'type.email' => 'http://schema.openid.net/contact/email',
    },

    Cheers,
    Edmund.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedJul 4, '09 at 4:13a
activeJan 9, '10 at 1:15a
posts6
users3
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase