Changed the app id to be retrieved from runtime.

Also updated the authentication flow.