cas

package
v0.0.0-...-1782bbb Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackOutput

type CallbackOutput struct {
	Redirect    string `json:"redirect"`
	Msg         string `json:"msg"`
	AccessToken string `json:"accessToken"`
	Username    string `json:"username"`
	Nickname    string `json:"Nickname"`
	Phone       string `yaml:"Phone"`
	Email       string `yaml:"Email"`
}

type Config

type Config struct {
	Enable          bool
	SsoAddr         string
	RedirectURL     string
	DisplayName     string
	CoverAttributes bool
	Attributes      struct {
		Nickname string
		Phone    string
		Email    string
	}
	DefaultRoles []string
}

type SsoClient

type SsoClient struct {
	Enable       bool
	Config       Config
	SsoAddr      string
	CallbackAddr string
	DisplayName  string
	Attributes   struct {
		Nickname string
		Phone    string
		Email    string
	}
	DefaultRoles    []string
	CoverAttributes bool
	sync.RWMutex
}

func New

func New(cf Config) *SsoClient

func (*SsoClient) Authorize

func (s *SsoClient) Authorize(redis storage.Redis, redirect string) (string, string, error)

Authorize return the cas authorize location and state

func (*SsoClient) GetDisplayName

func (s *SsoClient) GetDisplayName() string

func (*SsoClient) Reload

func (s *SsoClient) Reload(cf Config)

func (*SsoClient) ValidateServiceTicket

func (s *SsoClient) ValidateServiceTicket(ctx context.Context, ticket, state string, redis storage.Redis) (ret *CallbackOutput, err error)

Jump to

Keyboard shortcuts

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