腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
2
回答
Thread.CurrentPrincipal.Identity对
HttpContext.User.Identity
c#
、
asp.net
、
.net
、
form-authentication
、
current-principal
我知道
HttpContext.User.Identity
是在用户通过FormsAuthentication进行身份验证时
设置
的。但是Thread.CurrentPrincipal.Identity是
什么时候
设置
的?对于无法访问HttpContext的应用程序的其他层,这种情况仍然成立吗?
浏览 3
提问于2011-07-25
得票数 14
回答已采纳
2
回答
什么时候
设置
HttpContext.User.Identity
?
.net
、
asp.net
、
asp.net-mvc
但是下次我在这个浏览器会话上进行调用时,HttpContext.User.Identity.Name
设置
正确了。 那么
什么时候
设置
这个值呢?
浏览 0
提问于2011-07-06
得票数 25
回答已采纳
1
回答
HttpContext.User.Identity
与IClaimsPrincipal的区别
asp.net-mvc
、
wif
、
claims-based-identity
、
adfs2.0
我看到一些实现使用
HttpContext.User.Identity
进行授权,还有一些使用IClaimsPrincipal。根据我的理解(不太好),通过几篇文章,IClaimsPrincipal是一种基于声明的方法,为应用程序级别的使用提供
HttpContext.User.Identity
上下文。
浏览 0
提问于2012-12-19
得票数 1
回答已采纳
2
回答
谁
设置
HttpContext.User.Identity
的
HttpContext.User.Identity
属性?
asp.net-mvc
、
authentication
、
forms-authentication
谁
设置
了IsAuthenticated属性的
HttpContext.User.Identity
?user.Identity.IsAuthenticated) { }是通过调用方法( IsAuthenticated MVC4.0示例项目)
设置
的那么,是谁将该属性
设置
为TRUE以及何时
设置
?这是关于窗体身份验证的!TRUE的
设置
是否取决于ModelState.Value.Error集合?
浏览 0
提问于2011-12-28
得票数 28
回答已采纳
1
回答
如何使Asp.Net核心标识与OpenIdConnect协同工作
c#
、
asp.net-core
、
asp.net-identity
、
openid-connect
我已经手动
设置
了到声明类型名称的映射,但有时我需要从event OnTicketRecieved外部更新其他声明,即从控制器更新其他声明,所以在那个阶段,我确实需要以某种方式重新生成声明。我已经通过以下方式
设置
了openIdConnect: _services {
浏览 9
提问于2019-04-09
得票数 2
2
回答
.net自定义身份提供程序-implement登录/注销功能
asp.net-core
、
authentication
、
asp.net-identity
、
claims-based-identity
但是,在随后对api的调用中,
HttpContext.User.Identity
是空的。1)我是否应该(显式地)在上下文中
设置
标识?如果是,在哪里?我研究了官方.net核心存储库中的源代码,并注意到: SignInManager 的实现多少有点像我的(更准确地说,它没有在其内部
设置
HttpContext.User.Identity
),因此,在第一时间,我认为
HttpContext.User.Identity
是由SignInManager.PasswordSignInAsync的调用
浏览 3
提问于2020-04-30
得票数 0
3
回答
HttpContext.User.Idenity为空
asp.net
、
asp.net-mvc
、
forms-authentication
string[] _roles = _us.GetUserRoles(_username); 当我调试时,
HttpContext.User.Identity
总是为
浏览 0
提问于2010-02-01
得票数 2
回答已采纳
1
回答
如何在.Net核心3.1WebAPI控制器中获得索赔?
c#
、
authentication
、
.net-core
、
azure-active-directory
、
asp.net-core-webapi
在我的ASP.NET核心Web中有以下配置:services.AddMicrosoftIdentityWebApiAuthentication(configuration); { .RequireAuthenticatedUser() .
浏览 10
提问于2022-07-07
得票数 0
回答已采纳
2
回答
如何在单元测试中验证通过测试的日志消息?
c#
、
unit-testing
、
asp.net-core
、
moq
、
xunit
下面是我目前的测试
设置
: { 下面是在返回200时在端点中
设置
记录器的方式logText = LogFormatter.Format( WebUtilities
浏览 33
提问于2020-05-30
得票数 2
回答已采纳
1
回答
有办法从会话中获取
HttpContext.User.Identity
吗?
asp.net
、
session
、
forms-authentication
我正在考虑在登录时简单地
设置
Session["CurrentUserId"],然后在会话到期时访问它,但我认为可能有一种方法可以直接从会话中获取
HttpContext.User.Identity
?
浏览 2
提问于2013-10-03
得票数 0
1
回答
ASP.NET核心HttpContext.User始终为空
asp.net-core
、
.net-core
这在AccountController.Login操作方法中调用,结果返回Succeeded,用户将重定向到仪表板/索引操作方法,但是当我选中
HttpContext.User.Identity
时 ? 我尝试手动
设置
该值,但它仍然是空对象,即使我将其
设置
为null 下面是我使用的完整的ConfigureService方法 ?
浏览 71
提问于2020-04-03
得票数 0
回答已采纳
1
回答
Blazor服务器/ Asp.Net核心: Http请求在发布到IIS时不会将用户身份传递给
asp.net-core
、
iis
、
blazor
、
windows-authentication
我只能获得正在执行的服务帐户的标识,例如MVC控制器中的"MachineName\ApplicationPoolIdentity“或"MachineName\LocalService”(取决于在应用程序池
设置
中选择的标识我在IIS站点身份验证
设置
中启用了"Windows身份验证“,禁用了”匿名身份验证“。 我需要审计跟踪实现的用户标识,它为每个crud操作创建一个条目。在MVC Controller中,我尝试使用"this.User.Identity“或"
HttpContext.User.Identi
浏览 26
提问于2020-08-17
得票数 0
1
回答
ASP.NET核心3.0:如何将现有的身份验证转发给另一个请求-双跳问题?
c#
、
kerberos
、
windows-authentication
、
asp.net-core-3.0
我尝试
设置
SPN,如下所述: https://docs.microsoft.com/en-us/aspnet/core/security/authentication/windowsauth?
浏览 33
提问于2020-02-03
得票数 0
回答已采纳
1
回答
.net Identity SignInManager和
HttpContext.User.Identity
的关系
asp.net-core
、
authentication
、
asp.net-identity
、
claims-based-identity
signInManager.PasswordSignInAsync(username, password, false, false); 它成功地执行了登录,但是(在相同的方法执行中)之后,如果我检查
HttpContext.User.Identity
如果我调用另一个api方法并检查
HttpContext.User.Identity
的内容,这一次是否正确地填充了登录的用户信息。
浏览 19
提问于2020-04-30
得票数 0
1
回答
MVC 5控制器中User.Identity.Name的对象引用错误
c#
、
asp.net-mvc
、
asp.net-identity
对象引用未
设置
为对象的实例。
浏览 2
提问于2015-09-08
得票数 0
回答已采纳
1
回答
如何正确
设置
单元测试的模拟数据?
c#
、
unit-testing
、
asp.net-web-api
在API中为单元测试
设置
模拟数据有一些问题。从服务中检索数据。logText = LogFormatter.Format( WebUtilities.GetUser((ClaimsIdentity)
HttpContext.Us
浏览 0
提问于2020-05-27
得票数 2
回答已采纳
3
回答
IsAuthenticated在浏览器上工作--但不适用于Air!
asp.net
、
asp.net-mvc
、
air
编辑:另一条线索:在添加了一些更多的调试语句之后,我发现在从Air发出调用时filterContext.HttpContext.User.Identity没有正确
设置
-- Name属性是空的!会话ID是正确的,cookie ID是正确的-但是没有
设置
User.Identity。知道为什么会发生这种事吗?
浏览 0
提问于2011-07-05
得票数 5
回答已采纳
1
回答
我可以在控制器方法上拥有多个自定义授权属性吗?
asp.net
、
asp.net-mvc
、
asp.net-web-api
(
httpContext.User.Identity
is ClaimsIdentity)) return false; var identityClaimValue = claimsIdentity.FindFirst
浏览 0
提问于2014-12-14
得票数 0
回答已采纳
1
回答
授权属性意外工作
c#
、
asp.net-mvc
{ { { if (httpContext.User.Identity.IsAuthenticated)
浏览 0
提问于2015-09-22
得票数 2
1
回答
发布到IIS时Active PrincipalContext访问被拒绝
asp.net-core
、
active-directory
、
windows-authentication
我们有一个使用.NET身份验证的WindowsCore2.2WebApi。我们想创建一个页面,不同的管理员可以进入和添加/删除用户到特定的AD组。我们不能使用服务帐户或通用帐户,因为根据登录人员的不同,他们将能够管理不同的组。public UserApiModel AddGroupMember(string networkId, string groupName) using (PrincipalContext pc = new
浏览 0
提问于2020-03-10
得票数 0
点击加载更多
热门
标签
更多标签
云服务器
ICP备案
对象存储
云点播
即时通信 IM
活动推荐
运营活动
广告
关闭
领券