Skip to content

Repository files navigation

Fireauth


Build StatusCoverage Status

A Firebase token generator written in Go

Installation

go get -u github.com/zabawaba99/fireauth

Usage

Import fireauth

import"github.com/zabawaba99/fireauth"

Create a TokenGenerator

gen:=fireauth.New("foo")

Generate a token

data:= fireauth.Data{"uid": "1"}
token, err:=gen.CreateToken(data, nil)
iferr!=nil {
log.Fatal(err)
}
println("my token: ",token)

Options

You can also create a token with options

data:= fireauth.Data{"uid": "1"}
options:=&fireauth.Option{
NotBefore: 2,
Expiration: 3,
Admin: false,
Debug: true,
}
token, err:=gen.CreateToken(data, options)
iferr!=nil {
log.Fatal(err)
}
println("my token: ",token)

Check the GoDocs or Firebase Auth Documentation for more details

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b new-feature)
  3. Commit your changes (git commit -am 'Some cool reflection')
  4. Push to the branch (git push origin new-feature)
  5. Create new Pull Request

About

Firebase Auth Token Generator in Go

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages