ssoclient

package module
v0.0.0-...-1158626 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2018 License: MIT Imports: 16 Imported by: 3

README

ssoclient

golang client for the Barebones CMS SSO system ( http://barebonescms.com/documentation/sso/ )

This only supports the bare minimum I needed it to support.

  • Blowfish secret keys only
  • Dual encryption mode only
  • Remote login not supported
  • CanAutoLogin functionality not supported
  • User information updates not tested
  • Can read field and tag mapping information, whether users are admins, etc.

It is used in the disturbancesmlx project: https://github.com/gbl08ma/disturbancesmlx

License: MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginResponse

type LoginResponse struct {
	SSOID         string
	UserID        string
	Extra         string
	FieldMap      map[string]string
	Writable      map[string]bool
	TagMap        map[string]bool
	Admin         bool
	RecoveredInfo string
}

LoginResponse contains the information returned by GetLogin

type SSOClient

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

func NewSSOClient

func NewSSOClient(endpoint string, apiKey string, apiSecret string) (*SSOClient, error)

func (*SSOClient) GetLogin

func (c *SSOClient) GetLogin(ssoID string, expires int, updateInfo map[string]interface{}, ssoID2, rid string) (LoginResponse, error)

GetLogin retrieves user sign in information and request recovery information that was sent on InitLogin

func (*SSOClient) InitLogin

func (c *SSOClient) InitLogin(returnURL string, files bool, initMsg string, extra map[string]interface{}, info, appURL string) (url, rid string, err error)

InitLogin initiates a sign in. The caller is expected to save the recovery ID 'rid' to retrieve 'info' later and redirect the browser to the returned 'url'

func (*SSOClient) Logout

func (c *SSOClient) Logout(ssoID string) error

Logout signs out the user from the SSO server across all sign ins within the same namespace as the specified session

func (*SSOClient) Test

func (c *SSOClient) Test() error

Test checks the client connection to the endpoint. Useful to check if URLs and keys are correctly configured.

Jump to

Keyboard shortcuts

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