Jason Leveille's Blog
Web Development Intoxication
Now Viewing
Wed, 21 Jan 2009 12:51:56 +0000 1 Comment
I have finally created my first jQuery plugin. The punbbauth plugin should provide an easy way to sync authentication between your application and PunBB.
This plugin provides an easy way to hook into PunBB authentication login/logout. Hooks should be applied to your own applications login form and logout link. Another option is available to hook into an “access” link, however this will likely not see much use under most normal circumstances.
This plugin does not attempt to solve the issue of syncing your application with punbb. Rather, it attempts to solve the issue of single sign on when a user logs into your application.
As the plugin uses XHR to communicate with PunBB, it’s usage is of course limited to the XHR same origin policy.
http://jasonleveille.com/play/leveille-punbbauth-0.9.1-1-g7f97514.tar.gz
1: //assumes a username fieldname of username 2: //assumes a password fieldname of password $('.punbb').punbbauth();
1: //app_uname_field: <input name="uname_fieldname" /> 2: //app_pword_field: <input name="pword_fieldname" /> 3: //assumes form class structure: <form class="punbb login"> $('.punbb').punbbauth({ app_uname_field : 'uname_fieldname', app_pword_field : 'pword_fieldname' });
1: //assumes link class structure: <a class="punbb logout">...</a>
$('.punbb').punbbauth();
NOTE: This will likely not see very much use, as it requires access to a plain text password. See notes below
1: //assumes link class structure: <a class="punbb access">...</a>
$('.punbb').punbbauth({
punbb_username : 'username',
punbb_password : 'password'
});
Comments have been disabled for this post.
1 Comment for "PunBB Authentication JQuery Plugin"
Comment 1
leveille