Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 34890

Security in SharePoint Apps - Part 2

$
0
0

PREVIOUS:  Security in SharePoint Apps - Part 1

In Part 1 of this series I described how to think about an App Principal, and I mentioned that it is one of the main actors in determining who has rights to what content.  The other actor, of course, is the User Principal.  Between the two though, there are four possible security contexts that SharePoint may use when responding to requests for content.  In this post we’ll take a look at all four and how we determine when we use which.

It’s best to look at the process of determining the security context through a familiar paradigm, like a flowchart.  So here’s how our flowchart would look – our starting point is a request coming in to SharePoint, and we’ll take it from there.

  • Have user credentials been provided?
    • YES:  If user credentials are included, then the next thing we look at is where is the request going – is the request for an App Web (i.e. like a SharePoint-hosted app)?
      • NO:  If the request is not for an App Web, then that means it’s for a content web.  In that case, it’s like SharePoint as you have always known it – a user trying to get something out of a SharePoint site.  In that case we set a User Only security context with the request.
      • YES:  If the request is for an App Web, then it means that there is both an App AND a User that we need to add to the security context for the request.  In that case we set a User + App context to the request.
    • NO:  If user credentials were not included, then the next thing we need to determine is whether an App token was provided?

So those are the four identity contexts that we can have when making a request for content from SharePoint.  They’re important to know, because we can wind up in any of them when writing apps in general…but for purposes of this series we’re really just going to focus on User + App and App Only requests.   To make it a little easier to rationalize, here’s a picture of the flowchart I described above: 

 In the next post in this series we’ll talk about the simplest environment to write code in – an on-premise Low Trust App.

 

NEXT:  Security in SharePoint Apps - Part 3


Viewing all articles
Browse latest Browse all 34890

Trending Articles



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