更新时间:2023-11-14 GMT+08:00
分享

验证票据(CAS3.0)

功能介绍

应用验证票据,并获取用户属性信息。

URI

GET /api/v1/cas/p3/serviceValidate

表1 Query参数

参数

是否必选

参数类型

描述

service

String

应用接受票据的地址,必须与应用CAS配置中的应用回调URL一致。

ticket

String

票据,认证登录获取的Service Ticket。

format

String

响应用户信息的格式,可选择XML和JSON。

缺省值:XML

请求参数

响应参数

请求示例

查询CAS3.0接口验证票据,参数分别配置应用回调地址https://example.com及认证登录接口获取的认证票据ST-eYlKs8FrLCltwRwfm8AiwCxmQ8gAL...,使用JSON响应格式获取用户属性信息。

GET https://{domain_name}/api/v1/cas/p3/serviceValidate?service=https://example.com&ticket=ST-eYlKs8FrLCltwRwfm8AiwCxmQ8gAL...&format=JSON

响应示例

状态码: 200

请求成功。

  • 示例 1

    <cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
        <cas:authenticationSuccess>
            <cas:user>minghui</cas:user>
            <cas:attributes>
                <cas:authenticationDate>2020-02-11T09:28:14.987Z</cas:authenticationDate>
                <cas:longTermAuthenticationRequestTokenUsed>false</cas:longTermAuthenticationRequestTokenUsed>
                <cas:isFromNewLogin>true</cas:isFromNewLogin>
                <cas:date>2020-02-03T16:00:00.000Z</cas:date>
                <cas:birthday>2020-02-04T16:00:00.000Z</cas:birthday>
                <cas:createAt>2020-01-10T09:01:04.000Z</cas:createAt>
                <cas:disabledAt>null</cas:disabledAt>
                <cas:disabed>false</cas:disabed>
            </cas:attributes>
        </cas:authenticationSuccess>
    </cas:serviceResponse>
    
  • 示例 2

    {
      "serviceResponse" : {
        "authenticationSuccess" : {
          "attributes" : {
            "date" : "2020-02-03T16:00:00.000Z",
            "birthday" : "2020-02-04T16:00:00.000Z",
            "createAt" : "2020-01-10T09:01:04.000Z",
            "disabed" : false,
            "authenticationDate" : "2020-02-11T06:43:30.588Z",
            "longTermAuthenticationRequestTokenUsed" : false,
            "isFromNewLogin" : true
          },
          "user" : "minghui"
        }
      }
    }

状态码

状态码

描述

200

请求成功。

错误码

请参见错误码

分享:

    相关文档

    相关产品