idp

package
v0.9.2 Latest Latest
Warning

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

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

Documentation

Overview

Package idp provides an IdP middleware useful for different tasks such as serving metatada, processing an assertion or initiating a login request against a SP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator func(w http.ResponseWriter, r *http.Request) (*saml.Session, error)

Authenticator defines an authentication function that returns a *saml.Session value.

type LoginRequest

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

LoginRequest represents a login request that the IdP creates in order to try autenticating against a SP.

func (*LoginRequest) PostForm

func (lr *LoginRequest) PostForm(w http.ResponseWriter, r *http.Request)

PostForm creates and serves a form that is used to authenticate to the SP.

type Middleware

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

Middleware represents a middleware that provides tools for implementing a an identity provider.

func NewMiddleware

func NewMiddleware(idp *saml.IdentityProvider) *Middleware

NewMiddleware creates a middleware based on the given identity provider.

func (*Middleware) NewLoginRequest

func (m *Middleware) NewLoginRequest(spMetadataURL string, authFn Authenticator) (*LoginRequest, error)

NewLoginRequest creates a login request against an SP.

func (*Middleware) ServeMetadata

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

ServeMetadata generates and serves the IdP's metadata.xml file.

func (*Middleware) ServeSSO

func (m *Middleware) ServeSSO(authFn Authenticator) func(http.ResponseWriter, *http.Request)

ServeSSO creates and serves a SSO assertion based on a request.

Jump to

Keyboard shortcuts

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