WebAuth::Token(3) Generic WebAuth token handling


use WebAuth;
my $wa = WebAuth->new;
eval {
$token = WebAuth->token_decode ($wa, $data, $keyring);
print ref ($token), " received\n";
print "Encoded: ", $token->encode, "\n";
if ($@) {
# handle exception


WebAuth::Token is the parent class for all WebAuth token objects. Other than when creating a new token by decoding an encrypted token, this class will never be used directly. Instead, it is the base class for all other WebAuth::Token::* classes, each of which represents a specific type of protocol token.

The following token classes are currently supported:

Used by a WebAuth Application Server to store data, such as the identity of an authenticated user or the session key for that identity information.
Holds a credential for some other service, usually a Kerberos service ticket. It is sent back by the WebKDC to a WebAuth Application Server when requested using a proxy token, and the WAS also uses it to store the credentials in cookies.
Returned by the WebKDC in response to a request token if some error occurred in processing that request.
Identifies a user to a WebAuth Authentication Server. This token is sent from the WebKDC to the WAS following a user authentication to communicate the authentication information.
Used to communicate the user's username and password or other authentication secret from the WebLogin server to the WebKDC.
Used by a WebAuth Application Server to request other tokens from the WebKDC. This is returned by the WebKDC to a WebAuth Application Server if the WAS may need to request various tokens (particularly credential tokens).
Sent by the WebAuth Application Server to the WebKDC to initiate a request.

This token has two forms. The first is sent by the WAS to the WebKDC via a redirect to request either an id or a proxy token for the user, depending on whether the WAS will need credentials. The second is sent to the WebKDC as part of a request for a service token and contains only the command and creation time.

Stores user credentials or authentication information for later use by the WebKDC. This is the token that's stored as a single sign-on cookie in the user's browser, allowing the user to authenticate to subsequent web sites without reauthenticating. This token is also returned inside a proxy token to a WAS, which can then present it back to the WebKDC to obtain id or cred tokens.
Sent by the WebKDC to a WAS and returned by the WAS to the WebKDC as part of the request token. The purpose of this token is to store the session key used for encrypting the request token and its responses. It's encrypted in the WebKDC's long-term key, and is therefore used by the WebKDC to recover the session key without having local state.

Each of these tokens have different data elements and therefore different accessor functions, and each has its own separate documentation. See that individual documentation for the available operations on each type of token.


As with WebAuth module functions, failures are signaled by throwing WebAuth::Exception rather than by return status.
Given an encrypted and base64-encoded TOKEN, decode and decrypt it using the provided WebAuth::Keyring object. The return value will be a subclass of WebAuth::Token as described above in ``DESCRIPTION''.

Callers will normally want to check via isa() whether the returned token is of the type that the caller expected. Not performing that check can lead to security issues.

This is a convenience wrapper around the WebAuth token_decode() method.

The subclasses of WebAuth::Token also have a traditional new() constructor to create a new, empty token of that type.


Russ Allbery <[email protected]>