Monday, March 28, 2011 at 12:00 AM.

system.verbs.apps.OAuth.waitForAuthorization

on waitForAuthorization (adrapp, flPromptForPin) {
	<<Changes
		<<3/27/11; 12:46:03 AM by DW
			<<Called at the end of the appDance in its own thread, so the caller can redirect the user to the authorization page on the server site.
	local (i);
	for i = 1 to 60 {
		try {
			local (verifier = nil); //1/1/10 by DW
			if flPromptForPin {
				verifier = adrapp^.pin};
			OAuth.getAccessToken (adrapp^.accessTokenUrl, adrapp^.consumerkey, adrapp^.consumersecret, adrapp^.token, adrapp^.tokensecret, verifier, @adrapp^.accessToken, @adrapp^.accessTokenSecret);
			if sizeof (adrapp^.accessToken) > 0 {
				break}};
		<<else
			<<scratchpad.tryerror = tryerror
		clock.waitseconds (2)}};
bundle { //test code
	waitForAuthorization (scratchpad.adrapp, scratchpad.flPromptForPin)}



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.