idp

package
v0.0.0-...-d4089fd Latest Latest
Warning

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

Go to latest
Published: May 24, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddIDPFromConfig

func AddIDPFromConfig(file string)

Read a configuration file and add an identity provider

func Authenticate

func Authenticate(pi int, w http.ResponseWriter, r *http.Request)

Handle redirect to IdP indexed by pi

func Logout

func Logout(pi int, accessToken string)

Send revocation request to IdP

Types

type Auth

type Auth struct {
	URL         string // URL originally requested
	AccessToken string // Access token for session
	IDToken     string // Identity token
	ExpiresIn   int    // Timeout for session
	Name        string // Authenticated user's name
	ProviderIdx int    // Index of provider that authenticated
}

Structure to contain response data from identity provider

func Callback

func Callback(w http.ResponseWriter, r *http.Request) (Auth, error)

Handle callback from IdP

type IDPConfig

type IDPConfig struct {
	Name            string // Name of the identity provider
	Endpoint        string // Endpoint for ID services
	Revocation      string // Revocation endpoint, cf RFC 7009
	ClientID        string // Client ID embedded directly
	ClientIDEnv     string // Environment variable with Client ID
	ClientSecret    string // Client secret embedded directly
	ClientSecretEnv string // Environment variable with client secret
	RedirectURL     string // URL the provider should redirect to

}

Identity provider

type Provider

type Provider struct {
	Name string // Friendly name
	// contains filtered or unexported fields
}

Internal struct for recording provider info

func Providers

func Providers() []Provider

Return list of providers

Jump to

Keyboard shortcuts

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