Skip to content

Validate Ticket

The application validates the ticket and obtains user attribute information.

Request Description

http
GET https://{your_domain}/api/v1/cas/p3/serviceValidate

Request Parameters

Parameter NameChinese NameRequiredExample ValueDescription
serviceCallback AddressYesThe address where the application accepts the ticket, which must be consistent with the application Service address configured in the application CAS configuration.
ticketValidation TicketYessSoIc1T8Jh0wPCQmNzvATicket, Service Ticket obtained from authentication login.
formatFormat TypeNoFormat of the user information response. XML and JSON are optional. Default: XML

Request Example

GET https://{your_domain}/api/v1/cas/p3/serviceValidate?ticket=SoIc1T8Jh0wPCQmNzvA&service=http://casdemo.bccastle.com/demo/callback

Response Parameters

If returned successfully, in addition to the fixed parameter user being the username, custom parameter mappings can be added through Application Management > Authentication Configuration > Mapping Configuration. The mapped parameters are returned under attributes as described below, using the added mobile phone number mobile parameter as an example.

Parameter NameChinese NameRequiredExample ValueDescription
serviceResponseLevel 1: Response ObjectYesObject
authenticationSuccessLevel 2: Authentication SuccessYesObject
attributesLevel 3: ParametersYesObject
isFromNewLoginLevel 4YestrueFixed as true
authenticationDateLevel 4: Authentication TimeYes2022-03-08T01:34:12.460Z
longTermAuthenticationRequestTokenUsedLevel 4YesfalseFixed as false
mobileLevel 4No+86-17322881122Parameters dynamically added through authentication mapping configuration
userLevel 3: UsernameYes

Response Examples

Correct response example in JSON format

json
HTTP Status: 200 OK
format = JSON
{
    "serviceResponse": {
        "authenticationSuccess": {
            "attributes": {
                "isFromNewLogin": true,
                "authenticationDate": "2022-03-08T01:34:12.460Z",
                "longTermAuthenticationRequestTokenUsed": false,
                "mobile": "+86-17322881122"
            },
            "user": "admin"
        }
    }
}

Correct response example in XML format

xml
HTTP Status: 200 OK
format = XML
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
    <cas:authenticationSuccess>
        <cas:user>admin</cas:user>
        <cas:attributes>
            <cas:authenticationDate>2022-03-08T01:34:12.460Z</cas:authenticationDate>
            <cas:longTermAuthenticationRequestTokenUsed>false</cas:longTermAuthenticationRequestTokenUsed>
            <cas:isFromNewLogin>true</cas:isFromNewLogin>
            <cas:mobile>+86-17322881122</cas:mobile>
        </cas:attributes>
    </cas:authenticationSuccess>
</cas:serviceResponse>

Error response example in JSON format

json
HTTP Status: 200 OK
format=JSON
{
    "serviceResponse": {
        "authenticationFailure": {
            "code": "INVALID_TICKET",
            "description": "the ticket provided was not valid, ticket is 'jiVKc'"
        }
    }
}

Error response example in XML format

xml
HTTP Status: 200 OK
format=XML
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
    <cas:authenticationFailure code="INVALID_TICKET">
    	the ticket provided was not valid, ticket is 'jiVKc'  
    </cas:authenticationFailure>
</cas:serviceResponse>

BambooCloud IDaaS Open Platform