SharePoint 2013 Development--app Security model

Source: Internet
Author: User
<span id="Label3"></p>?<span style="font-family:Microsoft YaHei;font-size:14px;"><span style="font-family:Microsoft YaHei;font-size:14px;">Blog Address: http://blog.csdn.net/FoxDave</span></span><p><p><span style="font-size:14px;"><span style="font-family:Microsoft YaHei;font-size:14px;">Unless anonymous access is turned on for SharePoint sites, It is important that you have an authentication process (authentication) for inbound Requests.</span></span></p></p><p><p><span style="font-size:14px;"><span style="font-family:Microsoft YaHei;font-size:14px;">SharePoint authentication relies on directory services such as ad, identity providers (IdPs) like Google and facebook, services such as iis, Azure Access contro service (ACS), and active Directory Services (ADFS) to implement its authentication business Logic.</span></span></p></p><p><p><span style="font-size:14px;"><span style="font-family:Microsoft YaHei;font-size:14px;">based on the changes in the programming model, SharePoint 2013 needs to handle two types of Certifications: user authentication and app Authentication. For user authentication, SharePoint uses security groups and the Access Control list (ACL) stored in the content database to track, but another way is used for App,sharepoint. </span></span> <span style="font-size:14px;"> <span style="font-family:Microsoft YaHei;font-size:14px;">app authentication is provided to SharePoint via acs, called OAuth (oauth 2.0 is the next version of OAuth and requires https). This architecture allows users to authorize apps to work on their behalf without having to save their credential Information. </span></span></p></p><p><p><span style="font-size:14px;"><span style="font-family:Microsoft YaHei;font-size:14px;"><br></span></span></p></p><p><p><span style="font-size:14px;"><span style="font-family:Microsoft YaHei;font-size:14px;">When SharePoint receives an inbound request, it checks to see if the request contains a login token that identifies the user, and if that token is found, SharePoint assumes that the request was made by the authenticated user rather than the app. SharePoint then checks whether the destination URL for the request points to a standard site or a subsite (appweb) that has a relationship with the app. If the request points to a standard web site, SharePoint 2013 follows the typical authentication process of the previous version, and if it is related to the app, it initializes a context with user authentication and app Authentication.</span></span></p></p><p><p><span style="font-size:14px;"><span style="font-family:Microsoft YaHei;font-size:14px;">If no sign-in token is found, SharePoint knows that this is not a user-initiated Request. In this case, SharePoint looks for the OAuth token to identify the remote app. When a security token is found, it creates a context that contains both app authentication and user authentication (optional).</span></span></p></p><p><p><span style="font-size:14px;"><span style="font-family:Microsoft YaHei;font-size:14px;"><br></span></span></p></p><p><p><span style="font-size:14px;"><span style="font-family:Microsoft YaHei;font-size:14px;">Authentication (authentication), and then see authorization (Authorization). After the context is created, SharePoint decides what permissions to grant to the app, and as with user permissions, SharePoint tracks authorization through its own internal content Database.</span></span></p></p><p><p><span style="font-size:14px;"><span style="font-family:Microsoft YaHei;font-size:14px;">Specific authentication authorization flow can participate, more Information.</span></span></p></p><p><p><span style="font-size:14px;"><span style="font-family:Microsoft YaHei;font-size:14px;"></span></span></p></p><p><p><span style="font-size:14px;"><span style="font-family:Microsoft YaHei;font-size:14px;">Each app has a manifest.xml manifest file where developers can define the list of resources that the app needs to access through the Apppermissionrequests node, and the following code snippet provides an example (provider-hosted APP):</span></span></p></p><span style="font-size:14px;"><span style="font-size:14px;"><span style="font-family:Microsoft YaHei;font-size:14px;"></span></span></span><pre class="html" name="code"><pre class="html" name="code"><strong><apppermissionrequests allowapponlypolicy= "true" ></strong> <apppermissionrequest scope= "http://sharepoint/content/sitecollection" right= "Read"/> < Apppermissionrequest scope= "http://sharepoint/content/sitecollection/web/list" right= "Write" > < Property name= "basetemplateid" value= "101"/> </AppPermissionRequest> <apppermissionrequest Scope= "http://sharepoint/userprofilestore/feed" right= "Post"/> <apppermissionrequest scope= " Http://exchange/calendars "right=" Schedule "/></apppermissionrequests></pre></pre><p><p>Note the first line of this, the App's permission request is enabled with the App-only policy, which means that only the app (no current user) needs the necessary permissions. If you do not use this policy, it means that both the app and the current user need the necessary permissions to complete tasks such as accessing the entire site collection or creating items in the list, which will include both the app and the User's Identity.</p></p><p><p>The app-only policy can improve the App's permissions, allowing it to do more than the current user. When a user installs an app that contains an apppermissionrequest entry, that user must grant the permissions declared in the app manifest at installation Time.</p></p><p><p>ACS cannot be used in a Non-office 365 environment that is deployed locally, meaning that there is no OAuth token for on-premises Deployments. The local app needs a different security token, created by the Server-to-server (s2s) configuration, for more Information.</p></p><p><p><br></p></p><p><p>Regarding the security of the app, we should also know the following things:</p></p><p><p>Apps run in their own domain (preventing cross-site scripting attacks), written in javascript, but that doesn't mean they are safe. As a developer, you still need to consider the issue of security vulnerabilities and sensitive information leaks due to the design of your app.</p></p><p><p>The Sharepoint-hosted app does not specify a list or Site-level authorization, in other words, if an app has write access to a list, it is also available for another List.</p></p><p><p>This is a one-time process when the user is authorized for the provider-hosted app, and SharePoint doesn't know about it even after the App's logic code changes.</p></p><p><p>When an app uses an OAuth token to accomplish some task, another app on the page can also use the identity of the app and the User's Identity. In this case, the hacker can intercept the OAuth token through an unsecured communication protocol (HTTP).</p></p><p><p>therefore, when we develop the app, we need to design and try to use HTTPS to encrypt the communication Protocol.<br></p></p><p><p>SharePoint 2013 Development--app Security model</p></p></span>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.