digest

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package digest provides a limited implementation of HTTP Digest Authentication, as defined in RFC 2617.

Only the "auth" QOP directive is handled at this time, and while support for the SHA-256 algorithm is implemented here it does not actually work in either Chrome or Firefox.

For more info, see: https://tools.ietf.org/html/rfc2617 https://en.wikipedia.org/wiki/Digest_access_authentication

Index

Constants

View Source
const (
	MD5 digestAlgorithm = iota
	SHA256
)

Digest algorithms supported by this package

Variables

This section is empty.

Functions

func Challenge

func Challenge(realm string, algorithm digestAlgorithm) string

Challenge returns a WWW-Authenticate header value for the given realm and algorithm. If an invalid realm or an unsupported algorithm is given

func Check

func Check(req *http.Request, username, password string) bool

Check returns a bool indicating whether the request is correctly authenticated for the given username and password.

Types

This section is empty.

Jump to

Keyboard shortcuts

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