You would only need to use the the CC_Access_Key/Secret_Key in main.lua when you call the init() function(s). For what Dave did above, calling the gameNetwork.init() wasn’t necessary. You only need that for using our UI for showing leaderboards and such (but it handles logins too).
You can delay the coronaCloud.loginAPI() call until after you’ve captured the required information. As far as the authToken, it doesn’t need to be global. After you call loginAPI() it will set it for you as part of the coronaCloud object. If you choose to save the authToken for future restarts without having to login in, you would simply set it on re-start:
[lua]
coronaCloud.authToken = “yoursavedauthtoken”
[/lua]
after you call coronaCloud.init()