I am trying to construct a url using javascript within a page of the Application Web. The link will redirect to the remote Web and must include the ClientID of that autohosted web application. How do I get the Client_ID from the app web?
url = hostweburl + "/_layouts/15/appredirect.aspx?client_id=" + clientId + "&redirect_uri=" + encodeURIComponent(url);