httpauth

package
v0.0.0-...-1717a6b Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package httpauth provides http utilities for auth.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTokenNotFound informs that token was not found.
	ErrTokenNotFound = errors.New("token not found")
)

Functions

func ExtractBearerToken

func ExtractBearerToken(req *http.Request) (string, error)

ExtractBearerToken returns bearer token from Authorization header of the HTTP request.

func ExtractJSONWebKey

func ExtractJSONWebKey(req *http.Request, keyer authkit.JSONWebKeyer) (jose.JSONWebKey, error)

ExtractJSONWebKey returns JWK for the bearer token in Authorization header of the HTTP request. Returns ErrTokenNotFound if request doesn't have a bearer token.

func ExtractJSONWebToken

func ExtractJSONWebToken(req *http.Request) (*jwt.JSONWebToken, error)

ExtractJSONWebToken returns JWT parsed from bearer token in Authorization header of the HTTP request. Returns ErrTokenNotFound if request doesn't have a bearer token.

Types

This section is empty.

Jump to

Keyboard shortcuts

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