cas

package module
v0.0.0-...-11450e6 Latest Latest
Warning

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

Go to latest
Published: May 24, 2016 License: MIT Imports: 2 Imported by: 0

README

Go CAS Client

Forked from : github.com/lucasuyezu/golang-cas-client

WIP to test Jasig CAS server

How to request a Service Ticket on REST API

import (
  "fmt"
  "github.com/yvesago/golang-cas-client"
)

func main() {
  cas := cas.NewClient("https://server", "user", "pass")
  ticket, _ := cas.RequestServiceTicket("service")

  fmt.Println("ST is ", ticket)
}

How to validate a Service Ticket

import (
  "fmt"
  "github.com/yvesago/golang-cas-client"
)

func main() {
  cas := cas.NewService("https://server", "service-host")
  response, _ := cas.ValidateServiceTicket("service")

  fmt.Println("ST is ", response.Status)
}

TODO

  • Improve error handling
  • Invalidate a Service Ticket
  • Reuse a TGT (Ticket Granting Ticket) to generate more than one Service Ticket
  • Invalidate a TGT (sign out from all services)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(server, username, password string) client.CasClientConfig

func NewService

func NewService(server, hostService string) service.CasServiceConfig

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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