[Catalyst] Catalyst::Authentication::Credential::OAuth
Blaine Everingham
grandmasterblaine at hotmail.com
Wed Nov 24 19:30:00 GMT 2010
Thank you very much for this information.
I was pulling my hair out trying OAuth as I thought FBConnect was being de=
preciated.
> Date: Wed, 24 Nov 2010 10:12:27 +0200
> Subject: Re: [Catalyst] Catalyst::Authentication::Credential::OAuth
> From: bogdan at sinapticode.ro
> To: catalyst at lists.scsys.co.uk
> =
> you can also read http://www.catalystframework.org/calendar/2009/4
> =
> but as far as I know, the OAuth credential doesn't (yet) properly work
> with Facebook, there should be a new release soon fixing that.
> =
> On Wed, Nov 24, 2010 at 1:27 AM, Hernan Lopes <hernanlopes at gmail.com> wro=
te:
> > To integrate facebook login onto your site,
> > Have you tried Catalyst::Authentication::Credential::FBConnect ?
> > It works and lets you access users facebook id from $c->user->session_u=
id as
> > documented
> >
> > 1. You need to register under http://developers.facebook.com and regist=
er a
> > new application. You must include the exact address you will use on the
> > machine for it to work ie. "http://localhost:3000/"
> >
> > 2. you need to configure include these onto your myapp.conf
> >
> > <Plugin::Authentication>
> > default_realm facebook
> > <realms>
> > <facebook>
> > <credential>
> >
> > class FBConnect
> > api_key my_app_key
> > secret my_app_secret
> > app_name my_app_name
> > </credential>
> >
> > </facebook>
> > </realms>
> > </Plugin::Authentication>
> >
> > 3. you need a piece of javascript from facebook to create login button
> > (replace with your appId/fb_app_id as below):
> >
> > sub login_facebook : Path('/loginfacebook') : Args(0) {
> > my ( $self, $c ) =3D @_;
> > my $fb_app_id =3D '9999999999999999';
> > $c->stash( template =3D> \<<FBLOGIN
> >
> > <p><fb:login-button autologoutlink=3D"true"></fb:login-button></p>
> > <p><fb:like></fb:like></p>
> >
> > <div id=3D"fb-root"></div>
> >
> > <script>
> > window.fbAsyncInit =3D function() {
> > FB.init({appId: '$fb_app_id', status: true, cookie: true,
> > xfbml: true});
> >
> > FB.Event.subscribe('auth.sessionChange', function(response) {
> >
> > if (response.session) {
> > // A user has logged in, and a new cookie has been saved
> > window.location=3D"/fblogin"; //redirects user to our facebook =
login
> > so we can validate him and get his user id.
> >
> > } else {
> > // The user has logged out, and the cookie has been cleared
> > window.location=3D"/";
> > }
> > });
> > };
> >
> > (function() {
> > var e =3D document.createElement('script');
> >
> > e.type =3D 'text/javascript';
> > e.src =3D document.location.protocol +
> > '//connect.facebook.net/en_US/all.js';
> > e.async =3D true;
> >
> > document.getElementById('fb-root').appendChild(e);
> > }());
> > </script>
> > FBLOGIN
> > );
> > }
> >
> > 4. then , i created an action /fblogin to register facebook credentials
> > internally when user logs in (see in the js)
> >
> > sub fbauthenticate :Path('/fblogin') :Args(0) {
> > my ($self, $c) =3D @_;
> > if ($c->authenticate()) {
> > $c->log->debug($c->user->session_uid);
> > $c->log->debug($c->user->session_key);
> > $c->log->debug($c->user->session_expires);
> > }
> > $c->res->redirect('/');
> > }
> >
> >
> > So remember, register at the http://developer.facebook.com with the sam=
e url
> > your application will use, include ports if its not 80
> >
> > --Hernan
> >
> >
> > On Tue, Nov 23, 2010 at 8:32 PM, Blaine Everingham
> > <grandmasterblaine at hotmail.com> wrote:
> >>
> >> Hi,
> >>
> >> I was wondering if anyone has a simple example of using OAuth with
> >> facebook to allow user login, to your software.
> >>
> >> I keep getting the error "oauth_parameters_absent:scope", but
> >> Catalyst::Authentication::Credential::OAuth document does not outline =
where
> >> you are supposed to enter this.
> >>
> >> Thanks,
> >> Blaine
> >>
> >> _______________________________________________
> >> List: Catalyst at lists.scsys.co.uk
> >> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> >> Searchable archive:
> >> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> >> Dev site: http://dev.catalyst.perl.org/
> >>
> >
> >
> > _______________________________________________
> > List: Catalyst at lists.scsys.co.uk
> > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co=
.uk/
> > Dev site: http://dev.catalyst.perl.org/
> >
> >
> =
> =
> =
> -- =
> Bogdan Lucaciu
> http://www.sinapticode.com
> =
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.u=
k/
> Dev site: http://dev.catalyst.perl.org/
=
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20101124/1e1b2=
142/attachment.htm
More information about the Catalyst
mailing list