Version User Scope of changes
May 21 2008, 5:19 PM EDT DevinCanterberry 4 words added, 2 words deleted
May 8 2008, 1:14 PM EDT ryan_wetpaint 44 words added

Changes

Key:  Additions   Deletions

String WPCAPI.generateTicket()
This method is overloadable and should not be called directly.

When the Wetpaint ticket expires for a user that is still logged into your site, a new ticket must be requested before privileged operations are allowed to occur. Minimally, this method should perform an Ajax request to a service which will generate a new ticket for the user.

Note that this call should not call the UserService.login call directly. That call requires your credential signature, which should never be made available to the client for security purposes. Instead, have this method call a service on your servers that calls the UserService.login call.

Returns a new login ticket for the user.

Usage


if( window.WPCAPI ) {
WPCAPI.generateTicket = function() {

var request = new XMLHttpRequest();
request.open( "/your/ticket/service""GET", "GET""/your/ticket/service" );
request.onreadystatechange = function() {

if( request.readyState == 4 ) {
var ticket = null;
if( request.status == 200 ) ticket = request.responseXML.getElementsByTagName("ticket")[0];
WPCAPI.generateTicket_Callback(ticket);
}

};
request.send(null);

return null;

};

}