WPCAPI.generateTicketThis is a featured page


String WPCAPI.generateTicket()
This method is overridable 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( "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;

};

}




superwomyn
superwomyn
Latest page update: made by superwomyn , Oct 29 2008, 2:05 PM EDT (about this update About This Update superwomyn Changing overload to override. - superwomyn

1 word added
1 word deleted

view changes

- complete history)
More Info: links to this page
There are no threads for this page.  Be the first to start a new thread.

Related Content

  (what's this?Related ContentThanks to keyword tags, links to related pages and threads are added to the bottom of your pages. Up to 15 links are shown, determined by matching tags and by how recently the content was updated; keeping the most current at the top. Share your feedback on Wetpaint Central.)