ntlm

package module
v0.0.0-...-03e90d1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2015 License: BSD-3-Clause Imports: 12 Imported by: 0

README

ntlm

NTLMv1 client implementation for Go

Readable spec can be found at: http://davenport.sourceforge.net/ntlm.html

Documentation

Overview

Package ntlm is an NTLMv1 client implementation.

NTLM session started with sending Negotiate() to server. Server then responds with challenge, use ParseChallenge to get neccecary bits from it. Then use Authenticate() to generate authentication string.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnauthorized    = fmt.Errorf("ntlm: unauthorized")
	ErrUnsupportedAuth = fmt.Errorf("ntlm: unsupported authentication method")
)

Functions

func Authenticate

func Authenticate(username, password, domain string, challenge []byte) []byte

Authenticate generates auth message.

func Negotiate

func Negotiate() []byte

Negotiate generates Negotiate message.

func NewHTTPDialer

func NewHTTPDialer(username, password, domain, url string) func(network, address string) (net.Conn, error)

NewHTTPDialer returns dial func which dials remote address, GETs specified url with ntlm authentication headers then returns connection, if response status was anything, but 401.

Usage:

client = &http.Client{
	Transport: &http.Transport{
		Dial: ntlm.NewHTTPDialer(username, password, domain, url),
	},
}

func ParseChallenge

func ParseChallenge(b []byte) ([]byte, error)

ParseChallenge parses challenge provided by peer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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