Enable WindowsIdentity for CoreCLR.

This commit is contained in:
Chris Ross 2014-10-20 10:34:46 -07:00
parent b7fb516aac
commit a42a069dcf
2 changed files with 1 additions and 4 deletions

View File

@ -163,9 +163,7 @@ namespace Microsoft.Net.Http.Server
&& requestInfo->InfoType == UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_INFO_TYPE.HttpRequestInfoTypeAuth && requestInfo->InfoType == UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_INFO_TYPE.HttpRequestInfoTypeAuth
&& requestInfo->pInfo->AuthStatus == UnsafeNclNativeMethods.HttpApi.HTTP_AUTH_STATUS.HttpAuthStatusSuccess) && requestInfo->pInfo->AuthStatus == UnsafeNclNativeMethods.HttpApi.HTTP_AUTH_STATUS.HttpAuthStatusSuccess)
{ {
#if !ASPNETCORE50
return true; return true;
#endif
} }
return false; return false;
} }
@ -176,10 +174,8 @@ namespace Microsoft.Net.Http.Server
&& requestInfo->InfoType == UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_INFO_TYPE.HttpRequestInfoTypeAuth && requestInfo->InfoType == UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_INFO_TYPE.HttpRequestInfoTypeAuth
&& requestInfo->pInfo->AuthStatus == UnsafeNclNativeMethods.HttpApi.HTTP_AUTH_STATUS.HttpAuthStatusSuccess) && requestInfo->pInfo->AuthStatus == UnsafeNclNativeMethods.HttpApi.HTTP_AUTH_STATUS.HttpAuthStatusSuccess)
{ {
#if !ASPNETCORE50
return new WindowsPrincipal(new WindowsIdentity(requestInfo->pInfo->AccessToken, return new WindowsPrincipal(new WindowsIdentity(requestInfo->pInfo->AccessToken,
GetAuthTypeFromRequest(requestInfo->pInfo->AuthType).ToString())); GetAuthTypeFromRequest(requestInfo->pInfo->AuthType).ToString()));
#endif
} }
return new ClaimsPrincipal(new ClaimsIdentity()); // Anonymous / !IsAuthenticated return new ClaimsPrincipal(new ClaimsIdentity()); // Anonymous / !IsAuthenticated
} }

View File

@ -33,6 +33,7 @@
"System.Security.Claims": "4.0.0-beta-*", "System.Security.Claims": "4.0.0-beta-*",
"System.Security.Cryptography.X509Certificates": "4.0.0-beta-*", "System.Security.Cryptography.X509Certificates": "4.0.0-beta-*",
"System.Security.Principal": "4.0.0-beta-*", "System.Security.Principal": "4.0.0-beta-*",
"System.Security.Principal.Windows": "4.0.0-beta-*",
"System.Text.Encoding": "4.0.10-beta-*", "System.Text.Encoding": "4.0.10-beta-*",
"System.Text.Encoding.Extensions": "4.0.10-beta-*", "System.Text.Encoding.Extensions": "4.0.10-beta-*",
"System.Threading": "4.0.0-beta-*", "System.Threading": "4.0.0-beta-*",