package module
Version: v0.0.0-...-1daa6d7 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2015 License: MIT Imports: 7 Imported by: 0


persona docs

Package for using persona in webapps.

store := persona.NewStore(cookieSecret)
persona := persona.New(store, "http://localhost:8080", []string{""})

http.Handle("/", persona.Switch(SignInHandler, SignedOutHandler))
http.Handle("/secret", persona.Protect(SecretHandler))
http.Handle("/sign-in", persona.SignIn)
http.Handle("/sign-out", persona.SignOut)

then add this to your html,

<script src=""></script>
<script src=""></script>

  function gotAssertion(assertion) {
    // got an assertion, now send it up to the server for verification
    if (assertion !== null) {
        type: 'POST',
        url: '/sign-in',
        data: { assertion: assertion },
        success: function(res, status, xhr) {
        error: function(xhr, status, res) {
          alert("sign-in failure" + res);

  jQuery(function($) {
    $('#browserid').click(function() {;




This section is empty.


This section is empty.


This section is empty.


type PersonaHandlers

type PersonaHandlers struct {
	SignIn  http.Handler
	SignOut http.Handler
	Protect Protect
	Switch  Switch

func New

func New(store Store, audience string, users []string) PersonaHandlers

type Protect

type Protect func(http.Handler) http.Handler

func Protector

func Protector(store Store, users []string) Protect

type Store

type Store interface {
	Set(email string, w http.ResponseWriter, r *http.Request)
	Get(r *http.Request) string

func NewStore

func NewStore(secret string) Store

type Switch

type Switch func(http.Handler, http.Handler) http.Handler

func Switcher

func Switcher(store Store, users []string) Switch

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL