
# 验证票据 - ValidateService
#### 功能介绍
CAS3.0方式应用验证票据，并获取用户属性信息。
#### URI
GET /orgid/openapi/v1/cas/p3/serviceValidate
表1Query参数 
| 参数      | 是否必选 | 参数类型   | 描述                                                           |
|:---|:---|:---|:---|
| service | 是    | String | 登录时携带的回调地址。 最大长度：**1024**  |
| ticket  | 是    | String | 登录时系统返回的ticket。 最大长度：**128** |
   
#### 请求参数
```
GET https://orgid.huaweiapaas.cn/orgid/openapi/v1/cas/p3/serviceValidate?service=http://123456789.com&ticket=ST-******OwBG
```
#### 响应参数
**状态码： 200**
表2响应Body参数 
| 参数              | 参数类型                                                                 | 描述   |
|:---|:---|:---|
| serviceResponse | [ServiceResponse] object | 业务响应 |
   
 表3ServiceResponse 
| 参数                    | 参数类型                                                                                                                 | 描述   |
|:---|:---|:---|
| authenticationFailure | [CasServiceResponseAuthenticationFailure] object | 失败响应 |
| authenticationSuccess | [CasServiceResponseAuthenticationSuccess] object | 成功响应 |
   
 表4CasServiceResponseAuthenticationFailure 
| 参数          | 参数类型   | 描述   |
|:---|:---|:---|
| code        | String | 错误码  |
| description | String | 错误描述 |
   
 表5CasServiceResponseAuthenticationSuccess 
| 参数                  | 参数类型                                                                                                       | 描述     |
|:---|:---|:---|
| user                | String                                                                                                     | 用户标识   |
| proxyGrantingTicket | String                                                                                                     | 代理授权凭据 |
| proxies             | Array of strings                                                                                           | 代理     |
| attributes          | [CasAuthenticationSuccessAttributes] object | 属性     |
   
 表6CasAuthenticationSuccessAttributes 
| 参数                                     | 参数类型    | 描述           |
|:---|:---|:---|
| authenticationDate                     | String  | 认证时间         |
| longTermAuthenticationRequestTokenUsed | Boolean | true/false   |
| isFromNewLogin                         | Boolean | true/false   |
| token                                  | String  | 获取用户信息的token |
| logo                                   | String  | 用户头像URL      |
| displayName                            | String  | 用户显示名        |
| uid                                    | String  | 华为账号uid      |
   
#### 请求示例
无
#### 响应示例
**状态码： 200**
CAS3.0票据校验响应。
```
{
  "serviceResponse" : {
    "authenticationFailure" : null,
    "authenticationSuccess" : {
      "user" : "wss2111",
      "proxyGrantingTicket" : null,
      "proxies" : null,
      "attributes" : {
        "user_name" : "wss2111",
        "name" : "176******02",
        "mobile" : "176****0802",
        "email" : "l***@huawei.com",
        "user_id" : "1008600000106085748"
      }
    }
  }
}
```
#### 状态码
| 状态码 | 描述            |
|:---|:---|
| 200 | CAS3.0票据校验响应。 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-orgid/ErrorCode.html)。
