NAME

CAS - a simple CAS validation module.


SYNOPSIS

    use CAS;
    $cas = new CAS;
    ($status, $msg) = $cas->validate ($cas_validate_url, $service, $ticket);
    if ($status eq 'yes') {
        $userID = $msg;
    } else {
        if ($msg) {
            die ("error during validation: $msg");
        } else {
            die ("validation failed");
        }
    }


DESCRIPTION

Does simple CAS validation and returns a status (yes or no) and a user ID in case of success.

new

Create a new CAS object.

validate (cas_validation_url, service, ticket)

Does a CAS validation using the cas_validation_url, the service which should be extactly the same as what was used for login, and the ticket returned by the CAS login. This method returns a status and a message, as a list. In case of successful validation, the status is yes and the message is the CAS user ID used during login. In case of validation failure, the status is no and the message is empty. In case of error during the validation process (network or HTTP), the status is no and the message is an error message.


AUTHOR

Franck, franck@cvt.dk


VERSION

1.5 2004/10/11 13:57:14