public static GetS2SAccessTokenWithWindowsIdentity ( |
||
targetApplicationUri | Url of the target SharePoint site | |
identity | System.Security.Principal.WindowsIdentity | Windows identity of the user on whose behalf to create the access token |
return | string |
public static string GetS2SAccessTokenWithWindowsIdentity(
Uri targetApplicationUri,
WindowsIdentity identity)
{
string realm = string.IsNullOrEmpty(Realm) ? GetRealmFromTargetUrl(targetApplicationUri) : Realm;
JsonWebTokenClaim[] claims = identity != null ? GetClaimsWithWindowsIdentity(identity) : null;
return GetS2SAccessTokenWithClaims(targetApplicationUri.Authority, realm, claims);
}