Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I created a new Project for Sharepoint 2013 Apps in the Visual Studio 12. I choosed autohosted and added the link to my SP Web Home Site. I also added:

<AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="Read" />

in the AppManifest.

So why is the method TokenHelper.GetContextTokenFromRequet in the Default.aspx.cs always returning null?

share|improve this question
    
Im facing the same issue. However i have narrowed down the issue. If i open the page in modal dialog than GetContextTokenFromRequet returns always null. otherwise it is fine. The reason is request.Form["SPAppToken"] is null. Can somebody tell me the solution for this –  user19090 Nov 22 '13 at 6:40
    
are you trying for custom STS ? –  Nikhil Apr 10 at 0:44

2 Answers 2

Are you trying to deploy your app to Office 365 or an on-premises environment? If you are on-premises, you cannot use an Autohosted app. Instead, you will need to:

  • Configure a public and private test certificate for your environment (if you don't have Azure ACS configured)
  • Configure app isolation
  • Run some PowerShell cmdlets
  • (Optionally) Turn off the HTTPS requirement for OAuth in your dev environment
  • Create a new provider-hosted app in Visual Studio, configured to use a certificate for authentication

These steps are spelled out in much greater detail in the second half of this article. I have verified that they work with Preview 2 of the Microsoft Office Developer Tools for Visual Studio 2012, available for download here. (I mention this because Preview 2 of the Office Dev Tools was released after you posted this question.)

share|improve this answer

I don't know your sharepoint app is secure or not. I had same problem. fixed by updating start-up page from http:// to https:// in AppManifest.xml

<StartPage>https://sampledemonamexx.azurewebsites.net/Default.aspx?{StandardTokens}</StartPage>

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.