service

package module
v0.0.0-...-62189cf Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: MIT Imports: 3 Imported by: 0

README

jwt-golang

Semplice progetto con l'implementazione in GO dei Web Token in JSON (JWT, partendo dal modulo jwt-go.

TODO LIST: Permettere la customizzazione di Claims e Metodi di Signing. La versione attuale supporta solo l'algoritmo di firma: SigningMethodHS256.

How to use it

import "github.com/fabiosebastiano/jwt-golang"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWTService

type JWTService interface {
	GenerateToken(name string, admin bool) string
	ValidateToken(tokenString string) (*jwt.Token, error)
}

func NewJWTService

func NewJWTService(issuer string, secret string, expirationTime time.Duration) JWTService

NewJWTService creates a JWTService that generates a token. The issuer, secret and the expiration time (hours) are being passed as parameters.

Jump to

Keyboard shortcuts

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