PageRenderTime 42ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/docs/cas-server-documentation/protocol/CAS-Protocol-Specification.md

https://github.com/frett/cas
Markdown | 1299 lines | 904 code | 395 blank | 0 comment | 0 complexity | 7ab34a0dadbbfbb9c6132f0b7d5e028b MD5 | raw file
  1. ---
  2. layout: default
  3. title: CAS - CAS Protocol Specification
  4. category: Protocols
  5. ---
  6. <a name="headTop"/>
  7. *CAS Protocol 3.0 Specification*
  8. ================================
  9. **Authors, Version**
  10. ====================
  11. Author: Drew Mazurek
  12. Contributors:
  13. - Susan Bramhall
  14. - Howard Gilbert
  15. - Andy Newman
  16. - Andrew Petro
  17. - Robert Oschwald [CAS 3.0]
  18. - Misagh Moayyed
  19. Version: 3.0.3
  20. Release Date: 2017-12-01
  21. Copyright &copy; 2005, Yale University
  22. Copyright &copy; 2017, Apereo, Inc.
  23. <a name="head1"/>
  24. **1. Introduction**
  25. ===================
  26. This is the official specification of the CAS 1.0, 2.0 and 3.0 protocols.
  27. The Central Authentication Service (CAS) is a single-sign-on / single-sign-off protocol
  28. for the web.
  29. It permits a user to access multiple applications while providing their
  30. credentials (such as userid and password) only once to a central CAS Server
  31. application.
  32. <a name="head1.1"/>
  33. **1.1. Conventions & Definitions**
  34. ----------------------------------
  35. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
  36. "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
  37. interpreted as described in RFC 2119[1](<#1>).
  38. - "Client" refers to the end user and/or the web browser.
  39. - "CAS Client" refers to the software component that is integrated with a web
  40. application and interacts with the CAS server via CAS protocol.
  41. - "Server" refers to the Central Authentication Service server.
  42. - "Service" refers to the application the client is trying to access.
  43. - "Back-end service" refers to the application a service is trying to access
  44. on behalf of a client. This can also be referred to as the "target service."
  45. - "SSO" refers to Single Sign on.
  46. - "SLO" refers to Single Logout.
  47. - "<LF>" is a bare line feed (ASCII value 0x0a).
  48. <a name="head1.2"/>
  49. **1.2 Reference Implementation**
  50. --------------------------------
  51. The Apereo CAS-Server [8](<#8>) is the official reference implementation of the
  52. CAS Protocol Specification.
  53. Apereo CAS Server 4.x supports the CAS Protocol 3.0 Specification.
  54. <a name="head2"/>
  55. **2. CAS URIs**
  56. ===============
  57. CAS is an HTTP[2](<#2>),[3](<#3>)-based protocol that requires each of its
  58. components to be accessible through specific URIs. This section will discuss
  59. each of the URIs:
  60. | URI | Description
  61. |-----------------------------------|-------------------------------------------
  62. | `/login` | credential requestor / acceptor
  63. | `/logout` | destroy CAS session (logout)
  64. | `/validate` | service ticket validation
  65. | `/serviceValidate` | service ticket validation [CAS 2.0]
  66. | `/proxyValidate` | service/proxy ticket validation [CAS 2.0]
  67. | `/proxy` | proxy ticket service [CAS 2.0]
  68. | `/p3/serviceValidate` | service ticket validation [CAS 3.0]
  69. | `/p3/proxyValidate` | service/proxy ticket validation [CAS 3.0]
  70. <a name="head2.1"/>
  71. **2.1. /login as credential requestor**
  72. ---------------------------------------
  73. The `/login` URI operates with two behaviors: as a credential requestor, and as
  74. a credential acceptor. It responds to credentials by acting as a credential
  75. acceptor and otherwise acts as a credential requestor.
  76. If the client has already established a single sign-on session with CAS, the
  77. web browser presents to CAS a secure cookie containing a string identifying
  78. a ticket-granting ticket. This cookie is called the ticket-granting cookie.
  79. If the ticket-granting cookie keys to a valid ticket-granting ticket, CAS MAY
  80. issue a service ticket provided all the other conditions in this specification
  81. are met.
  82. See Section [3.6](<#head3.6>) for more information on ticket-granting cookies.
  83. <a name="head2.1.1"/>
  84. ### **2.1.1. parameters**
  85. The following HTTP request parameters may be passed to `/login` while it is
  86. acting as a credential requestor. They are all case-sensitive, and they all
  87. MUST be handled by `/login`.
  88. - `service` [OPTIONAL] - the identifier of the application the client is
  89. trying to access. In almost all cases, this will be the URL of the
  90. application. As a HTTP request parameter, this URL value MUST be
  91. URL-encoded as described in section 2.2 of RFC 3986 [[4](<#4>)].
  92. If a `service` is not specified and a single sign-on session does not yet
  93. exist, CAS SHOULD request credentials from the user to initiate a single
  94. sign-on session. If a `service` is not specified and a single sign-on
  95. session already exists, CAS SHOULD display a message notifying the client
  96. that it is already logged in.
  97. > Note: It is STRONGLY RECOMMENDED that all `service` urls be filtered via
  98. > the service management tool, such that only authorized and known
  99. > client applications would be able to use the CAS server.
  100. > Leaving the service management tool open to allow lenient access to
  101. > all applications will potentially increase the risk of service attacks
  102. > and other security vulnerabilities. Furthermore, it is RECOMMENDED that
  103. > only secure protocols such as `https` be allowed for client applications
  104. > for further strengthen the authenticating client.
  105. - `renew` [OPTIONAL] - if this parameter is set, single sign-on will be
  106. bypassed. In this case, CAS will require the client to present credentials
  107. regardless of the existence of a single sign-on session with CAS. This
  108. parameter is not compatible with the `gateway` parameter. Services
  109. redirecting to the `/login` URI and login form views posting to the `/login`
  110. URI SHOULD NOT set both the `renew` and `gateway` request parameters.
  111. Behavior is undefined if both are set. It is RECOMMENDED that CAS
  112. implementations ignore the `gateway` parameter if `renew` is set.
  113. It is RECOMMENDED that when the `renew` parameter is set its value be "true".
  114. - `gateway` [OPTIONAL] - if this parameter is set, CAS will not ask the client
  115. for credentials. If the client has a pre-existing single sign-on session
  116. with CAS, or if a single sign-on session can be established through
  117. non-interactive means (i.e. trust authentication), CAS MAY redirect the
  118. client to the URL specified by the `service` parameter, appending a valid
  119. service ticket. (CAS also MAY interpose an advisory page informing the
  120. client that a CAS authentication has taken place.) If the client does not
  121. have a single sign-on session with CAS, and a non-interactive authentication
  122. cannot be established, CAS MUST redirect the client to the URL specified by
  123. the `service` parameter with no "ticket" parameter appended to the URL. If
  124. the `service` parameter is not specified and `gateway` is set, the behavior
  125. of CAS is undefined. It is RECOMMENDED that in this case, CAS request
  126. credentials as if neither parameter was specified. This parameter is not
  127. compatible with the `renew` parameter. Behavior is undefined if both are
  128. set. It is RECOMMENDED that when the `gateway` parameter is set its value be
  129. "true".
  130. - `method` [OPTIONAL, CAS 3.0] - The `method` to be used when sending responses.
  131. While native HTTP redirects (`GET`) may be utilized as the default method,
  132. applications that require a `POST` response can use this parameter to indicate
  133. the method type. A `HEADER` method may also be specified
  134. to indicate the CAS final response such as `service` and `ticket`should be returned
  135. in form of HTTP response headers. It is up to the CAS server implementation to determine
  136. whether or not `POST` or `HEADER` responses are supported.
  137. <a name="head2.1.2"/>
  138. ### **2.1.2. URL examples of /login**
  139. Simple login example:
  140. `https://cas.example.org/cas/login?service=http%3A%2F%2Fwww.example.org%2Fservice`
  141. Don't prompt for username/password:
  142. `https://cas.example.org/cas/login?service=http%3A%2F%2Fwww.example.org%2Fservice&gateway=true`
  143. Always prompt for username/password:
  144. `https://cas.example.org/cas/login?service=http%3A%2F%2Fwww.example.org%2Fservice&renew=true`
  145. Use POST responses instead of redirects:
  146. `https://cas.example.org/cas/login?method=POST&service=http%3A%2F%2Fwww.example.org%2Fservice`
  147. <a name="head2.1.3"/>
  148. ### **2.1.3. response for username/password authentication**
  149. When `/login` behaves as a credential requestor, the response will vary depending
  150. on the type of credentials it is requesting. In most cases, CAS will respond by
  151. displaying a login screen requesting a username and password. This page MUST
  152. include a form with the parameters, "username", "password", and "lt". The form
  153. MAY also include the parameter "warn". If `service` was specified to `/login`,
  154. `service` MUST also be a parameter of the form, containing the value originally
  155. passed to `/login`. These parameters are discussed in detail in Section [2.2.1](#head2.2.1). The
  156. form MUST be submitted through the HTTP POST method to `/login` which will then
  157. act as a credential acceptor, discussed in Section [2.2](#head2.2).
  158. <a name="head2.1.4"/>
  159. ### **2.1.4. response for trust authentication**
  160. Trust authentication accommodates consideration of arbitrary aspects of the
  161. request as a basis for authentication. The appropriate user experience for trust
  162. authentication will be highly deployer-specific in consideration of local policy
  163. and of the logistics of the particular authentication mechanism implemented.
  164. When `/login` behaves as a credential requestor for trust authentication, its
  165. behavior will be determined by the type of credentials it will be receiving. If
  166. the credentials are valid, CAS MAY transparently redirect the user to the
  167. service. Alternately, CAS MAY display a warning that credentials were presented
  168. and allow the client to confirm that it wants to use those credentials. It is
  169. RECOMMENDED that CAS implementations allow the deployer to choose the preferred
  170. behavior. If the credentials are invalid or non-existent, it is RECOMMENDED that
  171. CAS displays to the client the reason why authentication failed, and possibly present
  172. the user with alternate means of authentication (e.g. username/password
  173. authentication).
  174. <a name="head2.1.5"/>
  175. ### **2.1.5. response for single sign-on authentication**
  176. If the client has already established a single sign-on session with CAS, the
  177. client will have presented its HTTP session cookie to `/login` and behavior will
  178. be handled as in Section [2.2.4](#head2.2.4). However, if the `renew` parameter
  179. is set, the behavior will be handled as in Section [2.1.3](#head2.1.3) or
  180. [2.1.4](#head2.1.4).
  181. <a name="head2.2"/>
  182. **2.2. /login as credential acceptor**
  183. --------------------------------------
  184. When a set of accepted credentials are passed to `/login`, `/login` acts as a
  185. credential acceptor and its behavior is defined in this Section.
  186. <a name="head2.2.1"/>
  187. ### **2.2.1. parameters common to all types of authentication**
  188. The following HTTP request parameters MAY be passed to `/login` while it is acting
  189. as a credential acceptor. They are all case-sensitive and they all MUST be
  190. handled by `/login`.
  191. - `service` [OPTIONAL] - the URL of the application the client is trying to
  192. access. As a HTTP request parameter, this URL value MUST be URL-encoded as
  193. described in Section 2.2 of RFC 1738 [[4](<#4>)]. CAS MUST redirect the
  194. client to this URL upon successful authentication. This is discussed in
  195. detail in Section [2.2.4](#head2.2.4). If the CAS Server operates in
  196. non-open mode (Service URLs allowed to use the CAS Server are registered
  197. within the CAS Server), the CAS Server MUST deny operation and print out
  198. a meaningful message if a non-authorized service URL is presented.
  199. > Note: It is STRONGLY RECOMMENDED that all `service` urls be filtered via
  200. > the service management tool, such that only authorized and known
  201. > client applications would be able to use the CAS server.
  202. > Leaving the service management tool open to allow lenient access to
  203. > all applications will potentially increase the risk of service attacks
  204. > and other security vulnerabilities. Furthermore, it is RECOMMENDED that
  205. > only secure protocols such as `https` be allowed for client applications
  206. > for further strengthen the authenticating client.
  207. - `warn` [OPTIONAL] - if this parameter is set, single sign-on MUST NOT be
  208. transparent. The client MUST be prompted before being authenticated to
  209. another service.
  210. - `method` [OPTIONAL] - The `method` to be used when sending responses. See
  211. section [2.1.1](<#head2.1.1>) for details
  212. <a name="head2.2.2"/>
  213. ### **2.2.2. parameters for username/password authentication**
  214. In addition to the OPTIONAL parameters specified in Section [2.2.1](#head2.2.1),
  215. the following HTTP request parameters MUST be passed to `/login` while it is
  216. acting as a credential acceptor for username/password authentication. They are
  217. all case-sensitive.
  218. - `username` [REQUIRED] - the username of the client that is trying to log in
  219. - `password` [REQUIRED] - the password of the client that is trying to log in
  220. - `lt` [OPTIONAL] - a login ticket. This is provided as part of the login form
  221. discussed in Section [2.1.3](#head2.1.3). The login ticket itself is discussed
  222. in Section [3.5](#head3.5).
  223. - `rememberMe` [OPTIONAL, CAS 3.0] - if this parameter is set, a Long-Term
  224. Ticket Granting Ticket might be created by the CAS server (referred to as
  225. Remember-Me support). It is subject to the CAS server configuration whether
  226. Long-Term Ticket Granting Tickets are supported or not.
  227. > Note: When Long-Term Ticket Granting Tickets (Remember Me) are supported by
  228. > the CAS Server, security considerations MUST be taken into account. This for
  229. > example includes shared computer usage. On CAS client systems it might be
  230. > necessary to handle Remember-Me logins different. See Section
  231. > [4.1](<#head4.1>) for details.
  232. <a name="head2.2.3"/>
  233. ### **2.2.3. parameters for trust authentication**
  234. There are no REQUIRED HTTP request parameters for trust authentication. Trust
  235. authentication MAY be based on any aspect of the HTTP request.
  236. <a name="head2.2.4"/>
  237. ### **2.2.4. response**
  238. One of the following responses MUST be provided by `/login` when it is operating
  239. as a credential acceptor.
  240. - successful login: redirect the client to the URL specified by the `service`
  241. parameter in a manner that will not cause the client's credentials to be
  242. forwarded to the `service`. This redirection MUST result in the client issuing
  243. a GET request to the `service`. The request MUST include a valid service
  244. ticket, passed as the HTTP request parameter, "ticket". See [Appendix
  245. B](<#head_appdx_b>) for more information. If `service` was not specified,
  246. CAS MUST display a message notifying the client that it has successfully
  247. initiated a single sign-on session.
  248. - failed login: return to `/login` as a credential requestor. It is RECOMMENDED
  249. in this case that the CAS server display an error message to the user
  250. describing why login failed (e.g. bad password, locked account, etc.),
  251. and if appropriate, provide an opportunity for the user to attempt to
  252. login again.
  253. <a name="head2.3"/>
  254. **2.3. /logout**
  255. ----------------
  256. `/logout` destroys a client's single sign-on CAS session. The ticket-granting
  257. cookie (Section [3.6](#head3.6)) is destroyed, and subsequent requests to `/login` will not
  258. obtain service tickets until the user again presents primary credentials (and
  259. thereby establishes a new single sign-on session).
  260. <a name="head2.3.1"/>
  261. ### **2.3.1. parameters**
  262. The following HTTP request parameter MAY be specified to `/logout`. It is case
  263. sensitive and SHOULD be handled by `/logout`.
  264. - `service` [OPTIONAL, CAS 3.0] - if a `service` parameter is specified, the
  265. browser might be automatically redirected to the URL specified by `service`
  266. after the logout was performed by the CAS server. If redirection by the
  267. CAS Server is actually performed depends on the server configuration.
  268. As a HTTP request parameter, the `service` value MUST be URL-encoded as
  269. described in Section 2.2 of RFC 1738 [[4](<#4>)].
  270. > Note: It is STRONGLY RECOMMENDED that all `service` urls be filtered via
  271. > the service management tool, such that only authorized and known
  272. > client applications would be able to use the CAS server.
  273. > Leaving the service management tool open to allow lenient access to
  274. > all applications will potentially increase the risk of service attacks
  275. > and other security vulnerabilities. Furthermore, it is RECOMMENDED that
  276. > only secure protocols such as `https` be allowed for client applications
  277. > for further strengthen the authenticating client.
  278. > Note: The `url` parameter defined in the former CAS 2.0 specification is
  279. > not a valid parameter in CAS 3.0 anymore. CAS Servers MUST ignore given
  280. > `url` parameters.
  281. > A CAS client MAY provide the `service` parameter as described above,
  282. > as this ensures the parameter is validated against the registered service
  283. > URLs when operating in non-open mode. See [2.3.2](#head2.3.2) for details.
  284. <a name="head2.3.2"/>
  285. ### **2.3.2. response**
  286. [CAS 1.0, CAS 2.0] `/logout` MUST display a page stating that the user has been
  287. logged out. If the "url" request parameter is implemented, `/logout` SHOULD also
  288. provide a link to the provided URL as described in Section [2.3.1](#head2.3.1).
  289. [CAS 3.0] `/logout` MUST display a page stating that the user has been logged out
  290. if no `service` parameter was provided. If a `service` request parameter with an
  291. encoded URL value is provided, the CAS server redirects to the given service URL
  292. after successful logout.
  293. > Note: When CAS Server operates in non-open mode (allowed Service URLs are
  294. > registered within the CAS Server), the CAS server MUST ensure that only
  295. > registered [service] parameter Service URLs are accepted for redirection.
  296. > The `url` parameter defined in the former CAS 2.0 specification is
  297. > not a valid parameter in CAS 3.0 anymore. CAS Servers MUST ignore given
  298. > `url` parameters.
  299. <a name="head2.3.3"/>
  300. ### **2.3.3 Single Logout**
  301. The CAS Server MAY support Single Logout (SLO). SLO means that the user gets
  302. logged out not only from the CAS Server, but also from all visited CAS client
  303. applications. If SLO is supported by the CAS Server, the CAS Server MUST send a
  304. HTTP POST request containing a logout XML document (see [Appendix
  305. C](<#head_appdx_c>)) to all service URLs provided to CAS during this CAS session
  306. whenever a Ticket Granting Ticket is explicitly expired by the user (e.g. during logout).
  307. CAS Clients that do not support the SLO POST requests MUST ignore these requests.
  308. SLO requests MAY also be initiated by the CAS Server upon TGT idle timeout.
  309. <a name="head2.3.3.1"/>
  310. #### **2.3.3.1 Server behaviour**
  311. The CAS Server SHALL ignore all errors that might occur on a Single Logout POST
  312. request to CAS Client applications service URLs. This ensures that any errors
  313. while sending the POST request do not disturb CAS Server performance and
  314. availability ("fire and forget").
  315. <a name="head2.3.3.2"/>
  316. #### **2.3.3.2 Client behaviour**
  317. Handling the logout POST request data is up to the CAS client. It is RECOMMENDED
  318. to logout the user from the application identified by the service ticket id sent
  319. in the SLO POST request.
  320. If the client supports SLO POST request handling, the client SHALL return a HTTP success
  321. status code.
  322. <a name="head2.4"/>
  323. ## **2.4. /validate [CAS 1.0]**
  324. `/validate` checks the validity of a service ticket. `/validate` is part of the CAS
  325. 1.0 protocol and thus does not handle proxy authentication. CAS MUST respond
  326. with a ticket validation failure response when a proxy ticket is passed to
  327. `/validate`.
  328. <a name="head2.4.1"/>
  329. ### **2.4.1. parameters**
  330. The following HTTP request parameters MAY be specified to `/validate`. They are
  331. case sensitive and MUST all be handled by `/validate`.
  332. - `service` [REQUIRED] - the identifier of the service for which the ticket was
  333. issued, as discussed in Section 2.2.1.
  334. As a HTTP request parameter, the `service` value MUST be URL-encoded as
  335. described in Section 2.2 of RFC 1738 [[4](<#4>)].
  336. > Note: It is STRONGLY RECOMMENDED that all `service` urls be filtered via
  337. > the service management tool, such that only authorized and known
  338. > client applications would be able to use the CAS server.
  339. > Leaving the service management tool open to allow lenient access to
  340. > all applications will potentially increase the risk of service attacks
  341. > and other security vulnerabilities. Furthermore, it is RECOMMENDED that
  342. > only secure protocols such as `https` be allowed for client applications
  343. > for further strengthen the authenticating client.
  344. - `ticket` [REQUIRED] - the service ticket issued by `/login`. Service tickets are
  345. described in Section 3.1.
  346. - `renew` [OPTIONAL] - if this parameter is set, ticket validation will only
  347. succeed if the service ticket was issued from the presentation of the user's
  348. primary credentials. It will fail if the ticket was issued from a single
  349. sign-on session.
  350. <a name="head2.4.2"/>
  351. ### **2.4.2. response**
  352. `/validate` will return one of the following two responses:
  353. On ticket validation success:
  354. yes<LF>
  355. On ticket validation failure:
  356. no<LF>
  357. <a name="head2.4.3"/>
  358. ### **2.4.3. URL examples of /validate**
  359. Simple validation attempt:
  360. `https://cas.example.org/cas/validate?service=http%3A%2F%2Fwww.example.org%2Fservice&ticket=ST-1856339-aA5Yuvrxzpv8Tau1cYQ7`
  361. Ensure service ticket was issued by presentation of primary credentials:
  362. `https://cas.example.org/cas/validate?service=http%3A%2F%2Fwww.example.org%2Fservice&ticket=ST-1856339-aA5Yuvrxzpv8Tau1cYQ7&renew=true`
  363. <a name="head2.5"/>
  364. **2.5. /serviceValidate [CAS 2.0]**
  365. -----------------------------------
  366. `/serviceValidate` checks the validity of a service ticket and returns an XML-fragment response.
  367. `/serviceValidate` MUST also generate and issue proxy-granting tickets when requested.
  368. `/serviceValidate` MUST NOT return a successful authentication if it receives a proxy ticket.
  369. It is RECOMMENDED that if `/serviceValidate` receives a proxy ticket, the error message in the XML
  370. response SHOULD explain that validation failed because a proxy ticket was passed
  371. to `/serviceValidate`.
  372. <a name="head2.5.1"/>
  373. ### **2.5.1. parameters**
  374. The following HTTP request parameters MAY be specified to `/serviceValidate`. They
  375. are case sensitive and MUST all be handled by `/serviceValidate`.
  376. - `service` [REQUIRED] - the identifier of the service for which the ticket was
  377. issued, as discussed in Section [2.2.1](#head2.2.1).
  378. As a HTTP request parameter, the `service` value MUST be URL-encoded as
  379. described in Section 2.2 of RFC 1738 [[4](<#4>)].
  380. > Note: It is STRONGLY RECOMMENDED that all `service` urls be filtered via
  381. > the service management tool, such that only authorized and known
  382. > client applications would be able to use the CAS server.
  383. > Leaving the service management tool open to allow lenient access to
  384. > all applications will potentially increase the risk of service attacks
  385. > and other security vulnerabilities. Furthermore, it is RECOMMENDED that
  386. > only secure protocols such as `https` be allowed for client applications
  387. > for further strengthen the authenticating client.
  388. - `ticket` [REQUIRED] - the service ticket issued by `/login`. Service tickets are
  389. described in Section [3.1](#head3.1).
  390. - `pgtUrl` [OPTIONAL] - the URL of the proxy callback. Discussed in Section
  391. [2.5.4](#head2.5.4).
  392. As a HTTP request parameter, the "pgtUrl" value MUST be URL-encoded as
  393. described in Section 2.2 of RFC 1738 [[4](<#4>)].
  394. - `renew` [OPTIONAL] - if this parameter is set, ticket validation will only
  395. succeed if the service ticket was issued from the presentation of the user's
  396. primary credentials. It will fail if the ticket was issued from a single
  397. sign-on session.
  398. - `format` [OPTIONAL] - if this parameter is set, ticket validation response
  399. MUST be produced based on the parameter value. Supported values are `XML`
  400. and `JSON`. If this parameter is not set, the default `XML` format will be used.
  401. If the parameter value is not supported by the CAS server, an error code
  402. MUST be returned as is described in section [2.5.3](<#head2.5.3>).
  403. <a name="head2.5.2"/>
  404. ### **2.5.2. response**
  405. `/serviceValidate` will return an XML-formatted CAS serviceResponse as described
  406. in the XML schema in Appendix A. Below are example responses:
  407. **On ticket validation success:**
  408. ```xml
  409. <cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
  410. <cas:authenticationSuccess>
  411. <cas:user>username</cas:user>
  412. <cas:proxyGrantingTicket>PGTIOU-84678-8a9d...</cas:proxyGrantingTicket>
  413. </cas:authenticationSuccess>
  414. </cas:serviceResponse>
  415. ```
  416. ```json
  417. {
  418. "serviceResponse" : {
  419. "authenticationSuccess" : {
  420. "user" : "username",
  421. "proxyGrantingTicket" : "PGTIOU-84678-8a9d..."
  422. }
  423. }
  424. }
  425. ```
  426. **On ticket validation failure:**
  427. ```xml
  428. <cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
  429. <cas:authenticationFailure code="INVALID_TICKET">
  430. Ticket ST-1856339-aA5Yuvrxzpv8Tau1cYQ7 not recognized
  431. </cas:authenticationFailure>
  432. </cas:serviceResponse>
  433. ```
  434. ```json
  435. {
  436. "serviceResponse" : {
  437. "authenticationFailure" : {
  438. "code" : "INVALID_TICKET",
  439. "description" : "Ticket ST-1856339-aA5Yuvrxzpv8Tau1cYQ7 not recognized"
  440. }
  441. }
  442. }
  443. ```
  444. For proxy responses, see section [2.6.2](<#head2.6.2>).
  445. <a name="head2.5.3"/>
  446. ### **2.5.3. error codes**
  447. The following values MAY be used as the "code" attribute of authentication
  448. failure responses. The following is the minimum set of error codes that all CAS
  449. servers MUST implement. Implementations MAY include others.
  450. - `INVALID_REQUEST` - not all of the required request parameters were present
  451. - `INVALID_TICKET_SPEC` - failure to meet the requirements of validation specification
  452. - `UNAUTHORIZED_SERVICE_PROXY` - the service is not authorized to perform proxy authentication
  453. - `INVALID_PROXY_CALLBACK` - The proxy callback specified is invalid. The credentials specified
  454. for proxy authentication do not meet the security requirements
  455. - `INVALID_TICKET` - the ticket provided was not valid, or the ticket did not
  456. come from an initial login and `renew` was set on validation. The body of
  457. the `<cas:authenticationFailure>` block of the XML response SHOULD describe
  458. the exact details.
  459. - `INVALID_SERVICE` - the ticket provided was valid, but the service specified
  460. did not match the service associated with the ticket. CAS MUST invalidate
  461. the ticket and disallow future validation of that same ticket.
  462. - `INTERNAL_ERROR` - an internal error occurred during ticket validation
  463. For all error codes, it is RECOMMENDED that CAS provide a more detailed message
  464. as the body of the `<cas:authenticationFailure>` block of the XML response.
  465. <a name="head2.5.4"/>
  466. ### **2.5.4. proxy callback**
  467. If a service wishes to proxy a client's authentication to a back-end service, it
  468. must acquire a proxy-granting ticket (PGT). Acquisition of this ticket is handled
  469. through a proxy callback URL. This URL will uniquely and securely identify the
  470. service that is proxying the client's authentication. The back-end service can
  471. then decide whether or not to accept the credentials based on the proxying
  472. service identifying callback URL.
  473. The proxy callback mechanism works as follows:
  474. 1. The service that is requesting a proxy-granting ticket (PGT) specifies upon
  475. initial service ticket or proxy ticket validation the HTTP request parameter
  476. "pgtUrl" to `/serviceValidate` (or `/proxyValidate`). This is a callback URL of
  477. the service to which CAS will connect to verify the service's identity. This
  478. URL MUST be HTTPS and CAS MUST evaluate the endpoint to establish peer trust.
  479. Building trust at a minimum involves utilizing PKIX and employing container trust to
  480. validate the signature, chain and the expiration window of the certificate of the
  481. callback url. The generation of the proxy-granting-ticket or the corresponding
  482. proxy granting ticket IOU may fail due to the proxy callback url failing to meet the minimum
  483. security requirements such as failure to establishing trust between peers or unresponsiveness
  484. of the endpoint, etc. In case of failure, no proxy-granting ticket will be issued and the CAS
  485. service response as described in Section [2.5.2](#head2.5.2) MUST NOT contain a
  486. `<proxyGrantingTicket>` block. At this point, the issuance of a
  487. proxy-granting ticket is halted and service ticket validation will
  488. fail. Otherwise, the process will proceed normally to step 2.
  489. 2. CAS uses an HTTP GET request to pass the HTTP request parameters `pgtId` and
  490. `pgtIou` to the pgtUrl endpoint. These entities are discussed in Sections [3.3](#head3.3) and
  491. [3.4](#head3.4), respectively. If the proxy callback url specifies any parameters, those
  492. MUST be preserved. CAS MUST also ensure that the endpoint is reachable by verifying
  493. the response HTTP status code from the GET request, as detailed in step #3. If the
  494. proxy service fails to authenticate or the endpoint responds with an unacceptable status
  495. code, proxy authentication MUST fail and CAS MUST respond with the appropriate error code
  496. as is described in section [2.5.3](<#head2.5.3>).
  497. 3. If the HTTP GET returns an HTTP status code of 200 (OK), CAS MUST respond to
  498. the `/serviceValidate` (or `/proxyValidate`) request with a service response
  499. (Section [2.5.2](#head2.5.2)) containing the proxy-granting ticket IOU (Section [3.4](#head3.4))
  500. within the `<cas:proxyGrantingTicket>` block. If the HTTP GET returns any
  501. other status code, except HTTP 3xx redirects, CAS MUST respond to the
  502. `/serviceValidate` (or `/proxyValidate`) request with a service response that
  503. MUST NOT contain a `<cas:proxyGrantingTicket>` block. CAS MAY follow any HTTP
  504. redirects issued by the `pgtUrl`. However, the identifying callback URL
  505. provided upon validation in the `<proxy>` block MUST be the same URL that was
  506. initially passed to `/serviceValidate` (or `/proxyValidate`) as the `pgtUrl`
  507. parameter.
  508. 4. The service, having received a proxy-granting ticket IOU in the CAS
  509. response, and both a proxy-granting ticket and a proxy-granting ticket IOU
  510. from the proxy callback, will use the proxy-granting ticket IOU to correlate
  511. the proxy-granting ticket with the validation response. The service will
  512. then use the proxy-granting ticket for the acquisition of proxy tickets as
  513. described in Section [2.7](#head2.7).
  514. <a name="head2.5.5"/>
  515. ### **2.5.5. attributes [CAS 3.0]**
  516. [CAS 3.0] The response document MAY include an optional <cas:attributes>
  517. element for additional authentication and/or user attributes. See [Appendix
  518. A](<#head_appdx_a>) for details.
  519. <a name="head2.5.6"/>
  520. ### **2.5.6. URL examples of /serviceValidate**
  521. Simple validation attempt:
  522. `https://cas.example.org/cas/serviceValidate?service=http%3A%2F%2Fwww.example.org%2Fservice&ticket=ST-1856339-aA5Yuvrxzpv8Tau1cYQ7`
  523. Ensure service ticket was issued by presentation of primary credentials:
  524. `https://cas.example.org/cas/serviceValidate?service=http%3A%2F%2Fwww.example.org%2Fservice&ticket=ST-1856339-aA5Yuvrxzpv8Tau1cYQ7&renew=true
  525. `
  526. Pass in a callback URL for proxying:
  527. `https://cas.example.org/cas/serviceValidate?service=http%3A%2F%2Fwww.example.org%2Fservice&ticket=ST-1856339-aA5Yuvrxzpv8Tau1cYQ7&pgtUrl=https://www.example.org%2Fservice%2FproxyCallback`
  528. <a name="head2.5.7"/>
  529. ### **2.5.7 Example response with custom attributes**
  530. ```xml
  531. <cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
  532. <cas:authenticationSuccess>
  533. <cas:user>username</cas:user>
  534. <cas:attributes>
  535. <cas:firstname>John</cas:firstname>
  536. <cas:lastname>Doe</cas:lastname>
  537. <cas:title>Mr.</cas:title>
  538. <cas:email>jdoe@example.org</cas:email>
  539. <cas:affiliation>staff</cas:affiliation>
  540. <cas:affiliation>faculty</cas:affiliation>
  541. </cas:attributes>
  542. <cas:proxyGrantingTicket>PGTIOU-84678-8a9d...</cas:proxyGrantingTicket>
  543. </cas:authenticationSuccess>
  544. </cas:serviceResponse>
  545. ```
  546. ```json
  547. {
  548. "serviceResponse" : {
  549. "authenticationSuccess" : {
  550. "user" : "username",
  551. "proxyGrantingTicket" : "PGTIOU-84678-8a9d...",
  552. "proxies" : [ "https://proxy1/pgtUrl", "https://proxy2/pgtUrl" ],
  553. "attributes" : {
  554. "firstName" : "John",
  555. "affiliation" : [ "staff", "faculty" ],
  556. "title" : "Mr.",
  557. "email" : "jdoe@example.orgmailto:jdoe@example.org",
  558. "lastname" : "Doe"
  559. }
  560. }
  561. }
  562. }
  563. ```
  564. <a name="head2.6"/>
  565. **2.6. /proxyValidate [CAS 2.0]**
  566. ---------------------------------
  567. `/proxyValidate` MUST perform the same validation tasks as `/serviceValidate` and
  568. additionally validate proxy tickets. `/proxyValidate` MUST be capable of
  569. validating both service tickets and proxy tickets. See Section
  570. [2.5.4](<#head2.5.4>) for details.
  571. <a name="head2.6.1"/>
  572. ### **2.6.1. parameters**
  573. `/proxyValidate` has the same parameter requirements as `/serviceValidate`. See
  574. Section [2.5.1](<#head2.5.1>).
  575. <a name="head2.6.2"/>
  576. ### **2.6.2. response**
  577. `/proxyValidate` will return an XML-formatted CAS serviceResponse as described in
  578. the XML schema in Appendix A. Below are example responses:
  579. Response on ticket validation success:
  580. ```xml
  581. <cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
  582. <cas:authenticationSuccess>
  583. <cas:user>username</cas:user>
  584. <cas:proxyGrantingTicket>PGTIOU-84678-8a9d...</cas:proxyGrantingTicket>
  585. <cas:proxies>
  586. <cas:proxy>https://proxy2/pgtUrl</cas:proxy>
  587. <cas:proxy>https://proxy1/pgtUrl</cas:proxy>
  588. </cas:proxies>
  589. </cas:authenticationSuccess>
  590. </cas:serviceResponse>
  591. ```
  592. ```json
  593. {
  594. "serviceResponse" : {
  595. "authenticationSuccess" : {
  596. "user" : "username",
  597. "proxyGrantingTicket" : "PGTIOU-84678-8a9d...",
  598. "proxies" : [ "https://proxy1/pgtUrl", "https://proxy2/pgtUrl" ]
  599. }
  600. }
  601. }
  602. ```
  603. > Note: when authentication has proceeded through multiple proxies, the order
  604. > in which the proxies were traversed MUST be reflected in the <cas:proxies>
  605. > block. The most recently-visited proxy MUST be the first proxy listed, and
  606. > all the other proxies MUST be shifted down as new proxies are added. In the
  607. > above example, the service identified by <https://proxy1/pgtUrl> was
  608. > visited first, and that service proxied authentication to the service
  609. > identified by <https://proxy2/pgtUrl>.
  610. Response on ticket validation failure:
  611. ```xml
  612. <cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'>
  613. <cas:authenticationFailure code="INVALID_TICKET">
  614. ticket PT-1856376-1HMgO86Z2ZKeByc5XdYD not recognized
  615. </cas:authenticationFailure>
  616. </cas:serviceResponse>
  617. ```
  618. ```json
  619. {
  620. "serviceResponse" : {
  621. "authenticationFailure" : {
  622. "code" : "INVALID_TICKET",
  623. "description" : "Ticket PT-1856339-aA5Yuvrxzpv8Tau1cYQ7 not recognized"
  624. }
  625. }
  626. }
  627. ```
  628. <a name="head2.6.3"/>
  629. ### **2.6.3 error codes**
  630. See section [2.5.3](<#head2.5.3>)
  631. <a name="head2.6.4"/>
  632. ### **2.6.4 URL examples of /proxyValidate**
  633. `/proxyValidate` accepts the same parameters as `/serviceValidate`. See Section
  634. [2.5.5](<#head2.5.5>) for use examples, substituting "proxyValidate" for
  635. "serviceValidate".
  636. <a name="head2.7"/>
  637. **2.7. /proxy [CAS 2.0]**
  638. -------------------------
  639. `/proxy` provides proxy tickets to services that have acquired proxy-granting
  640. tickets and will be proxying authentication to back-end services.
  641. <a name="head2.7.1"/>
  642. ### **2.7.1. parameters**
  643. The following HTTP request parameters MUST be specified to `/proxy`. They are both
  644. case-sensitive.
  645. - `pgt` [REQUIRED] - the proxy-granting ticket acquired by the service during
  646. service ticket or proxy ticket validation.
  647. - `targetService` [REQUIRED] - the service identifier of the back-end service.
  648. Note that not all back-end services are web services so this service identifier
  649. will not always be an URL. However, the service identifier specified here
  650. MUST match the `service` parameter specified to `/proxyValidate` upon validation
  651. of the proxy ticket.
  652. <a name="head2.7.2"/>
  653. ### **2.7.2. response**
  654. `/proxy` will return an XML-formatted CAS serviceResponse document as described in the XML
  655. schema in [Appendix A](#head_appdx_a). Below are example responses:
  656. Response on request success:
  657. ```xml
  658. <cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
  659. <cas:proxySuccess>
  660. <cas:proxyTicket>PT-1856392-b98xZrQN4p90ASrw96c8</cas:proxyTicket>
  661. </cas:proxySuccess>
  662. </cas:serviceResponse>
  663. ```
  664. Response on request failure:
  665. ```xml
  666. <cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
  667. <cas:proxyFailure code="INVALID_REQUEST">
  668. 'pgt' and 'targetService' parameters are both required
  669. </cas:proxyFailure>
  670. </cas:serviceResponse>
  671. ```
  672. ```json
  673. {
  674. "serviceResponse" : {
  675. "authenticationFailure" : {
  676. "code" : "INVALID_REQUEST",
  677. "description" : "'pgt' and 'targetService' parameters are both required"
  678. }
  679. }
  680. }
  681. ```
  682. <a name="head2.7.3"/>
  683. ### **2.7.3. error codes**
  684. The following values MAY be used as the `code` attribute of authentication
  685. failure responses. The following is the minimum set of error codes that all CAS
  686. servers MUST implement. Implementations MAY include others.
  687. - `INVALID_REQUEST` - not all of the required request parameters were present
  688. - `UNAUTHORIZED_SERVICE` - service is unauthorized to perform the proxy request
  689. - `INTERNAL_ERROR` - an internal error occurred during ticket validation
  690. For all error codes, it is RECOMMENDED that CAS provide a more detailed message
  691. as the body of the <cas:authenticationFailure> block of the XML response.
  692. <a name="head2.7.4"/>
  693. ### **2.7.4. URL example of /proxy**
  694. Simple proxy request:
  695. `https://server/cas/proxy?targetService=http%3A%2F%2Fwww.service.com&pgt=PGT-490649-W81Y9Sa2vTM7hda7xNTkezTbVge4CUsybAr`
  696. <a name="head3"/>
  697. ### **2.7.4 Service Ticket Lifecycle implications**
  698. The CAS Server implementation MAY update the parent Service Ticket (ST) lifetime upon proxy ticket generation.
  699. **2.8. /p3/serviceValidate [CAS 3.0]**
  700. ---------------------------------
  701. `/p3/serviceValidate` MUST perform the same validation tasks as `/serviceValidate` and
  702. additionally return user attributes in the CAS response. See
  703. Section [2.5](<#head2.5>) and Section [2.5.7](<#head2.5.7>) for details.
  704. <a name="head2.8.1"/>
  705. ### **2.8.1. parameters**
  706. `/p3/serviceValidate` has the same parameter requirements as `/serviceValidate`. See
  707. Section [2.5.1](<#head2.5.1>).
  708. **2.9. /p3/proxyValidate [CAS 3.0]**
  709. ---------------------------------
  710. `/p3/proxyValidate` MUST perform the same validation tasks as `/p3/serviceValidate` and
  711. additionally validate proxy tickets. See Section [2.8](<#head2.5>).
  712. <a name="head2.8.1"/>
  713. ### **2.9.1. parameters**
  714. `/p3/proxyValidate` has the same parameter requirements as `/p3/serviceValidate`. See
  715. Section [2.8.1](<#head2.8.1>).
  716. **3. CAS Entities**
  717. ===================
  718. <a name="head3.1"/>
  719. **3.1. service ticket**
  720. -----------------------
  721. A service ticket is an opaque string that is used by the client as a credential
  722. to obtain access to a service. The service ticket is obtained from CAS upon a
  723. client's presentation of credentials and a service identifier to `/login` as
  724. described in Section [2.2](#head2.2).
  725. <a name="head3.1.1"/>
  726. ### **3.1.1. service ticket properties**
  727. - Service tickets are only valid for the service identifier that was specified
  728. to `/login` when they were generated. The service identifier SHOULD NOT be
  729. part of the service ticket.
  730. - Service tickets MUST only be valid for one ticket validation attempt.
  731. Whether or not validation was successful, CAS MUST then invalidate the ticket,
  732. causing all future validation attempts of that same ticket to fail.
  733. - CAS SHOULD expire unvalidated service tickets in a reasonable period of time
  734. after they are issued. If a service presents an expired service ticket for
  735. validation, CAS MUST respond with a validation failure response.
  736. - It is RECOMMENDED that the validation response include a descriptive message
  737. explaining why validation failed.
  738. - It is RECOMMENDED that the duration a service ticket is valid before it expires
  739. be no longer than five minutes. Local security and CAS usage considerations
  740. MAY determine the optimal lifespan of unvalidated service tickets.
  741. - Service tickets MUST contain adequate secure random data so that a ticket is
  742. not guessable.
  743. - Service tickets MUST begin with the characters, `ST-`.
  744. - Services MUST be able to accept service tickets of up to 32 characters in length.
  745. It is RECOMMENDED that services support service tickets of up to 256 characters in
  746. length.
  747. <a name="head3.2"/>
  748. **3.2. proxy ticket**
  749. ---------------------
  750. A proxy ticket is an opaque string that a service uses as a credential to obtain
  751. access to a back-end service on behalf of a client. Proxy tickets are obtained
  752. from CAS upon a service's presentation of a valid proxy-granting ticket (Section
  753. [3.3](<#head3.3>)), and a service identifier for the back-end service to which
  754. it is connecting.
  755. <a name="head3.2.1"/>
  756. ### **3.2.1. proxy ticket properties**
  757. - Proxy tickets are only valid for the service identifier specified to `/proxy`
  758. when they were generated. The service identifier SHOULD NOT be part of the
  759. proxy ticket.
  760. - Proxy tickets MUST only be valid for one ticket validation attempt.
  761. Whether or not validation was successful, CAS MUST then invalidate
  762. the ticket, causing all future validation attempts of that same ticket to
  763. fail.
  764. - CAS SHOULD expire unvalidated proxy tickets in a reasonable period
  765. of time after they are issued. If a service presents for validation an
  766. expired proxy ticket, CAS MUST respond with a validation failure response.
  767. - It is RECOMMENDED that the validation response include a descriptive message
  768. explaining why validation failed.
  769. - It is RECOMMENDED that the duration a proxy ticket is valid before it expires
  770. be no longer than five minutes. Local security and CAS usage considerations
  771. MAY determine the optimal lifespan of unvalidated proxy tickets.
  772. - Proxy tickets MUST contain adequate secure random data so that a ticket is
  773. not guessable.
  774. - Proxy tickets SHOULD begin with the characters, `PT-`.
  775. - Back-end services MUST be able to accept proxy tickets of up to 32 characters
  776. in length.
  777. - It is RECOMMENDED that back-end services support proxy tickets of up to 256
  778. characters in length.
  779. <a name="head3.3"/>
  780. **3.3. proxy-granting ticket**
  781. ------------------------------
  782. A proxy-granting ticket (PGT) is an opaque string that is used by a service to obtain
  783. proxy tickets for obtaining access to a back-end service on behalf of a client.
  784. Proxy-granting tickets are obtained from CAS upon validation of a service ticket
  785. or a proxy ticket. Proxy-granting ticket issuance is described fully in Section
  786. [2.5.4](<#head2.5.4>).
  787. <a name="head3.3.1"/>
  788. ### **3.3.1. proxy-granting ticket properties**
  789. - Proxy-granting tickets MAY be used by services to obtain multiple proxy
  790. tickets. Proxy-granting tickets are not one-time-use tickets.
  791. - Proxy-granting tickets MUST expire when the client whose authentication is
  792. being proxied logs out of CAS.
  793. - Proxy-granting tickets MUST contain adequate secure random data so that a
  794. ticket is not guessable in a reasonable period of time through brute-force
  795. attacks.
  796. - Proxy-granting tickets SHOULD begin with the characters `PGT-`.
  797. - Services MUST be able to handle proxy-granting tickets of up to 64
  798. characters in length.
  799. - It is RECOMMENDED that services support proxy-granting tickets of up to
  800. 256 characters in length.
  801. <a name="head3.4"/>
  802. **3.4. proxy-granting ticket IOU**
  803. ----------------------------------
  804. A proxy-granting ticket IOU is an opaque string that is placed in the response
  805. provided by `/serviceValidate` and `/proxyValidate` used to correlate a service
  806. ticket or proxy ticket validation with a particular proxy-granting ticket. See
  807. Section [2.5.4](<#head2.5.4>) for a full description of this process.
  808. <a name="head3.4.1"/>
  809. ### **3.4.1. proxy-granting ticket IOU properties**
  810. - Proxy-granting ticket IOUs SHOULD NOT contain any reference to their
  811. associated proxy-granting tickets. Given a particular PGTIOU, it MUST NOT be
  812. possible to derive its corresponding PGT through algorithmic methods in a
  813. reasonable period of time.
  814. - Proxy-granting ticket IOUs MUST contain adequate secure random data so that
  815. a ticket is not guessable in a reasonable period of time through brute-force
  816. attacks.
  817. - Proxy-granting ticket IOUs SHOULD begin with the characters, `PGTIOU-`.
  818. - Services MUST be able to handle PGTIOUs of up to 64 characters in length. It
  819. is RECOMMENDED that services support PGTIOUs of up to 256 characters in
  820. length.
  821. <a name="head3.5"/>
  822. **3.5. login ticket**
  823. ---------------------
  824. A login ticket is an *optional* string that MAY be provided by `/login` as a credential requester
  825. and passed to `/login` as a credential acceptor for username/password
  826. authentication. Its purpose is to prevent the replaying of credentials due to
  827. bugs in web browsers.
  828. <a name="head3.5.1"/>
  829. ### **3.5.1. login ticket properties**
  830. - Login tickets issued by `/login` MUST be probabilistically unique.
  831. - Login tickets MUST only be valid for one authentication attempt. Whether or
  832. not authentication was successful, CAS MUST then invalidate the login
  833. ticket, causing all future authentication attempts with that instance of
  834. that login ticket to fail.
  835. - Login tickets SHOULD begin with the characters `LT-`.
  836. <a name="head3.6"/>
  837. **3.6. ticket-granting cookie**
  838. -------------------------------
  839. A ticket-granting cookie is an HTTP cookie[[5](<#5>)] set by CAS upon the
  840. establishment of a single sign-on session. This cookie maintains login state for
  841. the client, and while it is valid, the client can present it to CAS in lieu of
  842. primary credentials. Services can opt out of single sign-on through the `renew`
  843. parameter described in Sections [2.1.1](<#head2.1.1>), [2.4.1](<#head2.4.1>),
  844. and [2.5.1](<#head2.5.1>).
  845. <a name="head3.6.1"/>
  846. ### **3.6.1. ticket-granting cookie properties**
  847. - A ticket-granting cookie SHALL be set to expire at the end of the client's
  848. browser session if Long-Term support is not active ([4.1.1](<#head4.1.1>))
  849. for the corresponding TGT.
  850. - CAS SHALL set the cookie path to be as restrictive as possible. For example,
  851. if the CAS server is set up under the path /cas, the cookie path SHALL be set
  852. to /cas.
  853. - The value of ticket-granting cookies SHALL contain adequate secure random data
  854. so that a ticket-granting cookie is not guessable in a reasonable period of time.
  855. - The name of ticket-granting cookies SHOULD begin with the characters `TGC-`.
  856. - The value of ticket-granting cookies SHOULD follow the same rules as the ticket-granting
  857. ticket. Typically, the value of the ticket-granting cookies MAY contain the ticket-granting
  858. ticket itself as the representation of the authenticated single sign-on session.
  859. <a name="head3.7"/>
  860. **3.7. ticket and ticket-granting cookie character set**
  861. --------------------------------------------------------
  862. In addition to the above requirements, all CAS tickets and the value of the
  863. ticket-granting cookie MUST contain only characters from the set `{A-Z, a-z, 0-9}`,
  864. and the hyphen character `-`.
  865. <a name="head3.8"/>
  866. **3.8. ticket-granting ticket**
  867. ------------------------------
  868. A ticket-granting ticket (TGT) is an opaque string that is generated by the CAS
  869. server that is issued upon an successful authentication event upon `/login`.
  870. This ticket may be tied to the ticket-granting cookie which represents the
  871. state of the single sign-on session, with validity period and acts as the
  872. foundation and baseline for issuance of service tickets, proxy-granting
  873. tickets, and more.
  874. <a name="head3.8.1"/>
  875. ### **3.8.1. ticket-granting ticket properties**
  876. - Ticket-granting tickets MAY be used by services to obtain multiple service
  877. tickets. Ticket-granting tickets are not one-time-use tickets and are associated
  878. with a validity period and expiration policy.
  879. - Ticket-granting tickets MUST expire when the client whose authentication is
  880. being managed logs out of CAS.
  881. - Ticket-granting tickets MUST contain adequate secure random data so that a
  882. ticket is not guessable in a reasonable period of time through brute-force
  883. attacks.
  884. - Ticket-granting tickets SHOULD begin with the characters `TGT-`.
  885. - It is RECOMMENDED that ticket-granting tickets be encrypted when
  886. shared with other external resources in order to minimize security
  887. vulnerabilities as they are tied to the ticket-granting cookie
  888. and represent the authentication session.
  889. <a name="head4"/>
  890. **4. Optional Features**
  891. ========================
  892. <a name="head4.1"/>
  893. **4.1 Long-Term Tickets - Remember-Me [CAS 3.0]**
  894. -------------------------------------------------
  895. CAS Server MAY support Long-Term Ticket Granting Tickets (referred to as
  896. "Remember Me" functionality). If this feature is supported by the CAS Server, it
  897. is possible to perform recurring, non interactive re-logins to the CAS Server as
  898. long as the Long-Term Ticket Granting Ticket in the CAS Server is not expired
  899. and the browsers TGC Cookie is valid.
  900. <a name="head4.1.1"/>
  901. ### **4.1.1 Enabling Remember-Me (Login Page)**
  902. - The CAS Server MUST provide a checkbox on the login page to allow Remember-Me
  903. functionality.
  904. - By default, the checkbox