Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Provide static claim to read content stored in SharePoint Online from a public ASP.NET page

$
0
0

I am migrating a SharePoint 2007 solution to SharePoint Online (O365), and need to replicate a feature wherebysome information provided in SharePoint is displayed on a public web page.  The information is a SharePoint Calendar.  Each time the public page is hit (20 times a week maybe) the public page uses astored credential to read the date/time and title of the events only.  It is a quick way to check the calendar without being logged in and without showing more private details like location or body of the item. 

I had created an ASPX page in SharePoint that renders the view I'd like, then in the public ASP.NET page used HttpWebRequest to read the page, supplying a Credential using a stored username/password.

Again, for clarity, the user is not logged is, but sees a page with some basic facts from a SharePoint Online Calendar on an anonymous, non-SharePoint enabled, ASP.NET hosted page.  So I don't think this is actually an "app", nor can I use the SharePoint Client SDK. 

The code to do this was simple but returns a 403 using the new SharePoint.  I am under the impression that this is due to SharePoint Online's reliance on Claims Based Authentication. 

        WebRequest myRq = HttpWebRequest.Create(url);

        myRq.Credentials = new NetworkCredential(myAcct, myPWD, myDomain);
        WebResponse myRsp = myRq.GetResponse();

I need to know if there is a way to create and pass an appropriate claim using stored username password. 

(Yes, I know that the password needs to be stored securely, I've simplified the code above for clarity.)

-Frank Long


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>