proctor-authenticator-basic

command
v0.0.0-...-5f6b46d Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2019 License: MPL-2.0, MPL-2.0 Imports: 6 Imported by: 0

README

Overview

Sample of consuming an authenticator plugin. Run the Makefile and you should see similar output:

$ make
Data received: map[pass:blahblahblah user:user]
The response was: Basic dXNlcjpibGFoYmxhaGJsYWg= 

The main.go file sends the basic auth plugin a username and password:

	// Prepare to pass some data
	dataIn := make(map[string]string)
	dataIn["user"] = "user"
	dataIn["pass"] = "blahblahblah"

    // Invoke authenticator plugin and output response
	headers := basicAuth.Authenticate(dataIn)

The plugin.go responds with an HTTP authentication header for the given username and password:

	// Create auth header and add to dataOut
	authHeader := "Basic " + base64.StdEncoding.EncodeToString([]byte(auth))
	dataOut = make(map[string]string)
	dataOut["Authorization"] = authHeader

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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