• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • YouClaw
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
KXLF’s blog
能转的不写
   首页    新随笔    联系   管理     

随笔分类 -  Security

SPContext.Current.Web.CurrentUser 为 null

摘要:刚遇到个情况,记录一下。问题描述:网站为表单验证,并开启匿名。用户A从来没登陆过网站,也没有为A在网站中配置任何权限。就是说如果不开匿名,A无权法访问网站。这时使用A登陆网站(已开启匿名访问),SPContext.Current.Web.CurrentUser 就会为null。解决方法:将用户A或者所有验证用户加入访问者组,或者为A分配其他权限。配置完成后,重新用A登陆,SPContext.Current.Web.CurrentUser就可以正常工作了。原因:在没有被分配过任何权限的情况下,用户第一次登陆开启匿名的网站,Sharepint并不会登记该用户,而是当做匿名用户处理。所以会导致上述的 阅读全文
posted @ 2011-12-15 15:26 KXLF 阅读(1228) 评论(0) 推荐(0)
[转]Login over HTTPS from HTTP pages(使用https登陆)

摘要:Specifically we’ll have a look at how we can replace the SharePoint Welcome control with a custom control that meets the following requirements:Displays username and password fields in anonymous mode.Allow us to login securely (via HTTPS) from a unsecured page (e.g. the homepage).Display logged in u 阅读全文
posted @ 2011-12-12 10:11 KXLF 阅读(3038) 评论(0) 推荐(0)

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3