sp

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package sp provides tools for buildin an SP such as serving metadata, authenticating an assertion and building assertions for IdPs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessFunction

type AccessFunction func(*saml.Assertion) func(http.ResponseWriter, *http.Request)

AccessFunction is a function that returns an HTTP handler that is called after a successful assertion validation.

type AuthFunction

type AuthFunction func(http.ResponseWriter, *http.Request) bool

AuthFunction is an authentication handler that returns true after a successful authentication.

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

Middleware represents a SP middleware.

func NewMiddleware

func NewMiddleware(sp *saml.ServiceProvider) *Middleware

NewMiddleware creates a middleware based on the given service provider.

func (*Middleware) ServeAcs

func (m *Middleware) ServeAcs(grantFn AccessFunction) func(http.ResponseWriter, *http.Request)

ServeAcs creates an HTTP handler that can be used to authenticate and validate an assertion. If the assertion is valid the flow it passed to the given grantFn function.

func (*Middleware) ServeMetadata

func (m *Middleware) ServeMetadata(w http.ResponseWriter, r *http.Request)

ServeMetadata creates and serves a metadata XML file.

func (*Middleware) ServeRequestAuth

func (m *Middleware) ServeRequestAuth(w http.ResponseWriter, r *http.Request)

ServeRequestAuth creates an authentication assert and makes the user send it to the IdP (via redirection).

Jump to

Keyboard shortcuts

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