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
- Variables
- func GetEmail(gUser goth.User, customEmailField string) string
- func GetGroupId(gUser goth.User, CustomUserGroupField, DefaultUserGroup string, ...) string
- func GetUserID(gUser goth.User, CustomUserIDField string) string
- type DummyIdentityHandler
- func (d DummyIdentityHandler) CompleteIdentityAction(w http.ResponseWriter, r *http.Request, i interface{}, profile tap.Profile)
- func (d DummyIdentityHandler) CreateIdentity(i interface{}) (string, error)
- func (d DummyIdentityHandler) Init(conf interface{}) error
- func (d DummyIdentityHandler) LoginIdentity(user string, pass string) (string, error)
- type ModuleName
- type OAuthSettings
- type SSOAccessData
- type TokenSettings
- type TykIdentityHandler
- func (t *TykIdentityHandler) CompleteIdentityAction(w http.ResponseWriter, r *http.Request, i interface{}, profile tap.Profile)
- func (t *TykIdentityHandler) CompleteIdentityActionForDashboard(w http.ResponseWriter, r *http.Request, i interface{}, profile tap.Profile)
- func (t *TykIdentityHandler) CompleteIdentityActionForOAuth(w http.ResponseWriter, r *http.Request, i interface{}, profile tap.Profile)
- func (t *TykIdentityHandler) CompleteIdentityActionForPortal(w http.ResponseWriter, r *http.Request, i interface{}, profile tap.Profile)
- func (t *TykIdentityHandler) CompleteIdentityActionForTokenAuth(w http.ResponseWriter, r *http.Request, i interface{}, profile tap.Profile)
- func (t *TykIdentityHandler) CreateIdentity(i interface{}) (string, error)
- func (t *TykIdentityHandler) Init(conf interface{}) error
Constants ¶
const ( // Enums to identify which target it being used, dashbaord or portal, they are distinct. SSOForDashboard ModuleName = "dashboard" SSOForPortal ModuleName = "portal" InvalidModule ModuleName = "" DefaultSSOEmail string = "ssoSession@ssoSession.com" )
Variables ¶
var DummyLogTag string = "[DUMMY ID HANDLER]"
Functions ¶
func GetGroupId ¶ added in v1.1.0
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
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 DisplayName string GroupID string SSOOnlyForRegisteredUsers bool }
SSOAccessData is the data type used for speaking to the SSO endpoint in the advanced API
type TokenSettings ¶
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 dashboard 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