The point of event driven programming is that you just react to events, you don't wait for them.. Anyfish, what you're missing is the set_callback_signon_done callback, which tells you when the signon is finished. And in that callback you can then get on with the rest of your stuff.