Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zabawaba99/fireauth
Firebase Auth Token Generator in Go
https://github.com/zabawaba99/fireauth
Last synced: 1 day ago
JSON representation
Firebase Auth Token Generator in Go
- Host: GitHub
- URL: https://github.com/zabawaba99/fireauth
- Owner: zabawaba99
- License: mit
- Created: 2015-02-24T01:31:49.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-10-24T20:45:01.000Z (about 6 years ago)
- Last Synced: 2024-06-18T23:00:24.729Z (5 months ago)
- Language: Go
- Size: 24.4 KB
- Stars: 51
- Watchers: 11
- Forks: 10
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fireauth
---
[![Build Status](https://travis-ci.org/zabawaba99/fireauth.svg?branch=master)](https://travis-ci.org/zabawaba99/fireauth) [![Coverage Status](https://coveralls.io/repos/zabawaba99/fireauth/badge.svg?branch=master)](https://coveralls.io/r/zabawaba99/fireauth?branch=master)
---A Firebase token generator written in Go
## Installation
```bash
go get -u github.com/zabawaba99/fireauth
```## Usage
Import fireauth
```go
import "github.com/zabawaba99/fireauth"
```Create a TokenGenerator
```go
gen := fireauth.New("foo")
```Generate a token
```go
data := fireauth.Data{"uid": "1"}
token, err := gen.CreateToken(data, nil)
if err != nil {
log.Fatal(err)
}
println("my token: ",token)
```### Options
You can also create a token with options
```go
data := fireauth.Data{"uid": "1"}
options := &fireauth.Option{
NotBefore: 2,
Expiration: 3,
Admin: false,
Debug: true,
}
token, err := gen.CreateToken(data, options)
if err != nil {
log.Fatal(err)
}
println("my token: ",token)
```Check the [GoDocs](http://godoc.org/github.com/zabawaba99/fireauth) or
[Firebase Auth Documentation](https://www.firebase.com/docs/rest/guide/user-auth.html#section-overview) 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