JWTService

command module
Version: v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: MIT Imports: 7 Imported by: 0

README

Go Report Card GoDoc

JWT Service

This GRPC service handles tasks releated to generation and validation of JWTs.

Functions

FreshToken

This function takes user identity and scopes as an input. The function then creates a fresh access token from the inputs and returns the fresh access token.

AcessAndRefreshTokens

This function takes user identity and scopes as an input. The function then creates access and refresh token from the inputs and returns both of the tokens

RefreshTokens

This function takes a refresh token as an input. The function extracts user identity and scopes from the refresh token. The function then creates new access and refresh tokens and returns both of the tokens.

ValidateToken

This function takes any type of token as an input. The function validates that token and returns if the token is valid.

Token Claims

type Claims struct {
	UserIdentity  string
	IsFresh       bool
	IsRefresh     bool
	Scopes        []string
	CreationUTC   int64
	ExpirationUTC int64
}

Documentation

The Go Gopher

There is no documentation for this package.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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