Cataly...OpenID(3pm)
π Cataly...OpenID β the vibe π
okay bestie, so this is a page from the User Contributed Perl Documentation section, and it lives under the manual name Cataly...OpenID (in the <pink>3pm</pink> zone, aka Perl module docs, iykyk). sit down, grab a strawberry, we're learning OpenID auth in Catalyst and honestly? it's giving iconic. πβ¨
β¨ NAME β¨
Catalyst::Plugin::Authentication::Credential::OpenID β an OpenID credential for the Catalyst::Auth framework. that's it, that's the whole name section. short queen. π
πΈ SYNOPSIS πΈ
here's the setup, bestie. load these plugins:
use Catalyst qw/
Authentication
Authentication::Credential::OpenID
Session
Session::Store::FastMmap
Session::State::Cookie
/;
then optionally, in your MyApp.yaml, you can drop this config:
# MyApp.yaml -- optional
authentication:
openid:
use_session: 1
user_class: MyApp::M::User::OpenID
then whatever you want in your Controller pm:
sub default : Private {
my($self, $c) = @_;
if ($c->user_exists) { ... }
}
sub signin_openid : Local {
my($self, $c) = @_;
if ($c->authenticate_openid) {
$c->res->redirect( $c->uri_for('/') );
}
}
and the form, in foo.tt:
<form action="[% c.uri_for('/signin_openid') %]" method="GET">
<input type="text" name="openid_url" class="openid" />
<input type="submit" value="Sign in with OpenID" />
</form>
look at that. a whole login flow. we ate. π₯
π¦ DESCRIPTION π¦
Catalyst::Plugin::Authentication::Credential::OpenID is literally an OpenID credential for the Catalyst::Plugin::Authentication framework. that's the assignment. main character energy only. π
π METHODS π
authenticate_openid π
$c->authenticate_openid;
call this method in the action where you wanna authenticate your user via OpenID, bestie. it returns 0 if the auth did NOT pop off, and 1 if the user is authenticated. periodt.
the user class you specified with the user_class config β which defaults to Catalyst::Plugin::Authentication::User::Hash β gets instantiated with the following parameters:
urldisplayrssatomfoafdeclared_rssdeclared_atomdeclared_foaffoafmaker
see Net::OpenID::VerifiedIdentity for the deets, bestie. π
ngl, by default the authenticate_openid method goes looking for the claimed URI parameter from the form field named "openid_url", "openid_identifier" or "claimed_uri". want a different form field name? say less, call it like this:
$c->authenticate_openid( $c->req->param('myopenid_param') );
custom param name, custom slay. β¨
π DIFFERENCE WITH Authentication::OpenID π
okay so there's ALREADY a Catalyst::Plugin::Authentication::OpenID (aka Auth::OpenID), and this plugin is lowkey trying to deprecate it. the way that this is a glow-up, not a copy. π
- Don't use this plugin with Auth::OpenID since the method names will conflict and your app won't work. no cap, do not do it. π
- Auth::OpenID uses your root path (
/) as an authentication callback, but this plugin uses the current path, which means you can use this plugin with other Credential plugins, like Flickr or TypeKey. flexible queen. π - this plugin is NOT a drop-in replacement for Auth::OpenID, but your app needs only slight modifications to work with this one. tiny little tweaks, no biggie. π
- this plugin is based on the Catalyst authentication framework, which means you can specify
user_classorauth_storein your app config and this module does the right thing, like other Credential modules. it crates a new User object if authentication is successful, and it works with Session too. obsessed. β¨
π«Ά AUTHOR π«Ά
Six Apart, Ltd. <cpan@sixapart.com> β the icons who made this. π
π LICENSE π
this library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay, legally. βοΈβ¨
π SEE ALSO π
go read these next, bestie, they're the whole friend group:
Catalyst::Plugin::Authentication::OpenIDCatalyst::Plugin::Authentication::Credential::Flickr
and that's the whole page, babe π this lil doc came to you from perl v5.34.0, dated 2022-06-09, and the manual name up top is Cataly...OpenID(3pm) β go forth and authenticate, you're gonna do amazing, fr fr. ππ¦π
π¦ where this page comes from
- debian bookworm: libcatalyst-plugin-authentication-credential-openid-perl 0.03+rp-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcatalyst-plugin-authentication-credential-openid-perl 0.03+rp-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcatalyst-plugin-authentication-credential-openid-perl 0.03+rp-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcatalyst-plugin-authentication-credential-openid-perl 0.03+rp-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatalyst-plugin-authentication-credential-openid-perl 0.03+rp-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms