共用方式為


SPUser.RequireRequestToken Property

Gets or sets a value that indicates whether the SPUser object requires a request token.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Public Property RequireRequestToken As Boolean
    Get
    Set
'Usage
Dim instance As SPUser
Dim value As Boolean

value = instance.RequireRequestToken

instance.RequireRequestToken = value
public bool RequireRequestToken { get; set; }

Property Value

Type: System.Boolean
true if the SPUser object requires a request token; otherwise false.

Remarks

The RequireRequestToken property can be true only if the IsApplicationPrincipal property is true.

The practical effect of setting RequireRequestToken to true is that the application represented by the SPUser object must be hosted in a Web Part on a Microsoft SharePoint Foundation page to which a real user; that is, a user who is not an application principal; has navigated. The application can take actions and retrieve data only if both the real user and the application principal have permission for the action or data.

We recommend that RequireRequestToken be true whenever IsApplicationPrincipal is true. If it is not, then any person running the application would have all of the permissions of the application, even if that person does not have those permissions.

For more information on the role of the request token, see the links in the Related Topics section.

See Also

Reference

SPUser Class

SPUser Members

Microsoft.SharePoint Namespace

SPExternalApplicationRequestProperties.RequestTokenPrefix

Microsoft.SharePoint.Client.ExternalApplicationRequestToken

ApplicationContext.RequestToken

ClientConstants.RequestTokenHeader

RequestForwarder.RequestToken

Other Resources

How to: Create an Application Principal User

Lifecycle of a Silverlight Request to a Web Application