jwt

package
v0.0.0-...-800783e Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2016 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Overview

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseFromRequest

func ParseFromRequest(req engine.Request, keyFunc jwt.Keyfunc) (token *jwt.Token, err error)

Types

type JWT

type JWT struct {
	Secret string
	CondFn func(echo.Context) bool
}

func New

func New(secret string) *JWT

func (*JWT) Claims

func (j *JWT) Claims(c echo.Context) map[string]interface{}

func (*JWT) Ignore

func (j *JWT) Ignore(on bool, c echo.Context)

func (*JWT) Response

func (j *JWT) Response(values map[string]interface{}) (tokenString string, err error)

本函数所生成结果的用法 用法一:写入header头的属性“Authorization”中,值设为:前缀BEARER加tokenString的值 用法二:发送post或get参数“access_token”,值设为:tokenString的值

func (*JWT) Validate

func (j *JWT) Validate() echo.MiddlewareFunc

Jump to

Keyboard shortcuts

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