cas

package
v0.0.0-...-bd3bc89 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoginPath    = "/login"
	LogoutPath   = "/logout"
	ValidatePath = "/serviceValidate"
)

Variables

This section is empty.

Functions

func GetResponseBody

func GetResponseBody(url string) (string, error)

func New

func New(preAuthentication func(ctx iris.Context) bool, postAuthentication func(ctx iris.Context, u interface{})) context.Handler

Types

type Adapter

type Adapter struct{}

func (*Adapter) AddPolicy

func (*Adapter) AddPolicy(sec string, ptype string, rule []string) error

func (*Adapter) LoadPolicy

func (*Adapter) LoadPolicy(model model.Model) error

func (*Adapter) RemoveFilteredPolicy

func (*Adapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error

func (*Adapter) RemovePolicy

func (*Adapter) RemovePolicy(sec string, ptype string, rule []string) error

func (*Adapter) SavePolicy

func (*Adapter) SavePolicy(model model.Model) error

type AttributesStruct

type AttributesStruct struct {
	XMLName       xml.Name `xml:"attributes"`
	UserMobile    string   `xml:"UserMobile"`
	UserName      string   `xml:"UserName"`
	UserTitle     string   `xml:"UserTitle`
	DeptFullName  string   `xml:"DeptFullName`
	UserNum       string   `xml:"UserNum`
	UserNameHex   string   `xml:"UserNameHex`
	OfficeAddress string   `xml:"OfficeAddress`
	UserEmail     string   `xml:"UserEmail`
	ACCOUNT       string   `xml:"ACCOUNT`
	UserBelong    int8     `xml:"UserBelong`
	UserId        int16    `xml:"UserId`
	DeptName      string   `xml:"DeptName`
}

type AuthSuccessStruct

type AuthSuccessStruct struct {
	XMLName    xml.Name         `xml:"authenticationSuccess"`
	User       string           `xml:"user"`
	Attributes AttributesStruct `xml:"attributes"`
}

type Client

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

func (*Client) Authentication

func (c *Client) Authentication(ctx iris.Context)

func (*Client) RedirectToLogin

func (c *Client) RedirectToLogin(ctx iris.Context)

RedirectToLogout replies to the request with a redirect URL to authenticate with CAS.

func (*Client) RedirectToLogout

func (c *Client) RedirectToLogout(ctx iris.Context)

type Response

type Response struct {
	XMLName               xml.Name          `xml:"serviceResponse"`
	AuthenticationFailure string            `xml:"authenticationFailure"`
	AuthSuccess           AuthSuccessStruct `xml:"authenticationSuccess"`
}

Jump to

Keyboard shortcuts

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