identityHandlers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2018 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

package identityHandlers provides a collection of handlers for target systems,

these handlers create accounts and sso tokens

package identityHandlers provides a collection of handlers for target systems,

these handlers create accounts and sso tokens

Index

Constants

This section is empty.

Variables

View Source
var DummyLogTag string = "[DUMMY ID HANDLER]"
View Source
var TykAPILogTag string = "[TYK ID HANDLER]" // log tag

Functions

This section is empty.

Types

type DummyIdentityHandler

type DummyIdentityHandler struct{}

DummyIdentityHandler is a dummy hndler, use for testing

func (DummyIdentityHandler) CompleteIdentityAction

func (d DummyIdentityHandler) CompleteIdentityAction(w http.ResponseWriter, r *http.Request, i interface{}, profile tap.Profile)

CompleteIdentityAction is called when an authenticated callback event is triggered, it should speak to the target system and generate / login the user. In this case it redirects the user to the ReturnURL.

func (DummyIdentityHandler) CreateIdentity

func (d DummyIdentityHandler) CreateIdentity(i interface{}) (string, error)

Dummy method

func (DummyIdentityHandler) Init

func (d DummyIdentityHandler) Init(conf interface{}) error

Init will set up the configuration of the handler

func (DummyIdentityHandler) LoginIdentity

func (d DummyIdentityHandler) LoginIdentity(user string, pass string) (string, error)

Dummy method

type ModuleName

type ModuleName string // To separate out target modules of the dashboard
const (
	// Enums to identify which target it being used, dashbaord or portal, they are distinct.
	SSOForDashboard ModuleName = "dashboard"
	SSOForPortal    ModuleName = "portal"
	InvalidModule   ModuleName = ""
)

type OAuthSettings

type OAuthSettings struct {
	APIListenPath string
	RedirectURI   string
	ResponseType  string
	ClientId      string
	Secret        string
	BaseAPIID     string
	NoRedirect    bool
}

OAuthSettings determine the OAuth parameters for the tap.GenerateOAuthTokenForClient action

type SSOAccessData

type SSOAccessData struct {
	ForSection   ModuleName
	OrgID        string
	EmailAddress string
}

SSOAccessData is the data type used for speaking to the SSO endpoint in the advanced API

type TokenSettings

type TokenSettings struct {
	BaseAPIID string
	Expires   int64
}

type TykIdentityHandler

type TykIdentityHandler struct {
	API   *tyk.TykAPI
	Store tap.AuthRegisterBackend
	// contains filtered or unexported fields
}

TykIdentityHandler provides an interface for generating SSO identities on a tyk node

func (*TykIdentityHandler) CompleteIdentityAction

func (t *TykIdentityHandler) CompleteIdentityAction(w http.ResponseWriter, r *http.Request, i interface{}, profile tap.Profile)

CompleteIdentityAction will log a user into Tyk dashbaord or Tyk portal

func (*TykIdentityHandler) CompleteIdentityActionForDashboard

func (t *TykIdentityHandler) CompleteIdentityActionForDashboard(w http.ResponseWriter, r *http.Request, i interface{}, profile tap.Profile)

CompleteIdentityActionForDashboard handles a dashboard identity. No ise is created, only an SSO login session

func (*TykIdentityHandler) CompleteIdentityActionForOAuth

func (t *TykIdentityHandler) CompleteIdentityActionForOAuth(w http.ResponseWriter, r *http.Request, i interface{}, profile tap.Profile)

func (*TykIdentityHandler) CompleteIdentityActionForPortal

func (t *TykIdentityHandler) CompleteIdentityActionForPortal(w http.ResponseWriter, r *http.Request, i interface{}, profile tap.Profile)

CompleteIdentityActionForPortal will generate an identity for a portal user based, so it will AddOrUpdate that user depnding on if they exist or not and validate the login using a one-time nonce.

func (*TykIdentityHandler) CompleteIdentityActionForTokenAuth

func (t *TykIdentityHandler) CompleteIdentityActionForTokenAuth(w http.ResponseWriter, r *http.Request, i interface{}, profile tap.Profile)

func (*TykIdentityHandler) CreateIdentity

func (t *TykIdentityHandler) CreateIdentity(i interface{}) (string, error)

CreateIdentity will generate an SSO token that can be used with the tyk SSO endpoints for dash or portal. Identity is assumed to be a goth.User object as this is what we are stnadardiseing on.

func (*TykIdentityHandler) Init

func (t *TykIdentityHandler) Init(conf interface{}) error

initialise th Tyk handler, the Tyk handler *requires* initialisation with the TykAPI handler global set up in main

Jump to

Keyboard shortcuts

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