Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bestpractical/jifty-plugin-openid
https://github.com/bestpractical/jifty-plugin-openid
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/bestpractical/jifty-plugin-openid
- Owner: bestpractical
- Created: 2009-12-10T18:15:32.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2010-06-23T21:47:35.000Z (over 14 years ago)
- Last Synced: 2023-04-13T18:31:27.045Z (over 1 year ago)
- Language: Perl
- Homepage: http://search.cpan.org/dist/jifty-plugin-openid
- Size: 151 KB
- Stars: 3
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README
- Changelog: Changes
Awesome Lists containing this project
README
NAME
Jifty::Plugin::OpenID - Provides OpenID authentication for your jifty
appDESCRIPTION
Provides OpenID authentication for your appUSAGE
Config
please provide "OpenIDSecret" in your etc/config.yml , the "OpenIDUA" is
optional , OpenID Plugin will use LWPx::ParanoidAgent by default.---
application:
OpenIDSecret: 1234
OpenIDUA: LWP::UserAgentor you can set "OpenIDUserAgent" environment var in command-line:
OpenIDUserAgent=LWP::UserAgent bin/jifty server
if you are using LWPx::ParanoidAgent as your openid agent. you will need
to provide "JIFTY_OPENID_WHITELIST_HOST" for your own OpenID server.export JIFTY_OPENID_WHITELIST_HOST=123.123.123.123
User Model
Create your user model , and let it uses
Jifty::Plugin::OpenID::Mixin::Model::User to mixin "openid" column. and
a "name" method.use TestApp::Record schema {
column email =>
type is 'varchar';};
use Jifty::Plugin::OpenID::Mixin::Model::User;sub name {
my $self = shift;
return $self->email;
}Note: you might need to declare a "name" method. because the OpenID
CreateOpenIDUser action and SkeletonApp needs current_user->username to
show welcome message and success message , which calls
"brief_description" method. See Jifty::Record for "brief_description"
method.View
OpenID plugin provides AuthenticateOpenID Action. so that you can render
an AuthenticateOpenID in your template:form {
my $openid = new_action( class => 'AuthenticateOpenID',
moniker => 'authenticateopenid' );
render_action( $openid );
};this action renders a form which provides openid url field. and you will
need to provide a submit button in your form.form {
my $openid = new_action( class => 'AuthenticateOpenID',
moniker => 'authenticateopenid' );# ....
render_action( $openid );
outs_raw(
Jifty->web->return(
to => '/openid_verify_done',
label => _("Login with OpenID"),
submit => $openid
));
};the "to" field is for verified user to redirect to. so that you will
need to implement a template called "/openid_verify_done":template '/openid_verify_done' => page {
h1 { "Done" };
};AUTHORS
Alex Vandiver, CorneliusLICENSE
Copyright 2005-2009 Best Practical Solutions, LLC.This program is free software and may be modified and distributed under
the same terms as Perl itself.