1

I am a beginner of CAS. I want to get ticket by OpenAPI, and I can provided the user name and password (which can be encrypted). but I don't know how to realize it? Thanks for your advice!

gary
  • 21
  • 3

1 Answers1

0

Welcome to CAS!

REST protocol support in Apereo CAS has been available since the early days of CAS 3.x. The REST protocol allows one to model applications as users, programmatically acquiring service tickets to authenticate to other applications. This is achieved by exposing a way to REST-fully obtain a Ticket Granting Ticket and then use that to obtain a Service Ticket.

You can invoke the REST API to authenticate a user and get back a ticket-granting ticket:

curl -k -X POST -H "Content-Type: Application/x-www-form-urlencoded" \
  https://sso.example.org/cas/v1/tickets \
  -d "username=casuser&password=Mellon"

The ticket-granting ticket that is produced can be used to obtain a service ticket:

curl -X POST -H "Content-Type: Application/x-www-form-urlencoded" \
  -H "Accept: application/json" https://sso.example.org/cas/v1/tickets/ \
  TGT-2-abcdefg?service=https://your.application.com
ST-1-VGF-yzB8

See this link for more details.

Misagh Moayyed
  • 4,154
  • 2
  • 15
  • 25