Implementing Persona with Gorilla

175 views
Skip to first unread message

Kamil Kisiel

unread,
Oct 4, 2012, 1:22:01 AM10/4/12
to goril...@googlegroups.com
With the recent talk about Mozilla's persona authentication system (https://developer.mozilla.org/en-US/docs/Persona) I figured I'd see how hard it would be to implement in Go and using some Gorilla libraries. Turns out it wasn't very hard at all. I've made the code available at https://gist.github.com/3831610 in case anyone else wants to take a look.

I'm not sure if there would be any benefit of turning it in to a library as it's quite simple to implement and a fair bit of the functionality depends on client-side code, but hopefully the example is enough to get others started.

Let me know if you have any feedback :)

RoboTamer

unread,
Oct 4, 2012, 3:50:48 AM10/4/12
to goril...@googlegroups.com
did you know about this:

Kamil Kisiel

unread,
Oct 4, 2012, 12:40:26 PM10/4/12
to goril...@googlegroups.com
Nope, but I do now.

Shane Hanna

unread,
Oct 8, 2012, 9:10:04 AM10/8/12
to goril...@googlegroups.com
I implemented persona myself a couple days ago as well. Even though I found that repo on inspecting the source a few things put me off straight away like Post() instead of PostForm() and building the form values manually. The cookbook had a better example, https://github.com/mozilla/browserid-cookbook/blob/master/go/browserid.go which I then turned into a package for my needs: https://gist.github.com/3852389 

Interestingly the cookbook is only 10 days old and uses a different javascript navigation callback 'get' instead of 'onlogin/onlogout'. I don't know why.

Not that any of this relates to Gorilla (which is awesome btw) just thought it was worth mentioning the cookbook.

Shane.
Reply all
Reply to author
Forward
0 new messages