【问题标题】:Windows NT token with ADFS to get Remote user Roles使用 ADFS 获取远程用户角色的 Windows NT 令牌
【发布时间】:2011-11-30 00:49:48
【问题描述】:

我创建了一个启用 ADFS windows NT 的 tokenapp 将 IIS 7 配置为在身份验证中启用 Windows NT 令牌并将 url 回复为https://adfsweb.treyresearch.net/tokenapp

我将此应用程序作为基于 Windows NT 令牌的应用程序添加到 adfsresource 应用程序中。

使用此 web.config 文件 (http://blogs.technet.com/b/adfs_documentation/archive/2006/08/03/444865.aspx#DSDOC_BKMK_667328988_f5db_446a_9261_00b4)

default.aspx.cs如下。

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Security.Principal;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Label1.Text = HttpContext.Current.User.Identity.Name;
        WindowsIdentity i = (WindowsIdentity)HttpContext.Current.User.Identity;

        IdentityReferenceCollection irc = i.Groups;

        foreach (IdentityReference ir in irc)
        {
            Label2.Text += ir.Translate(typeof(NTAccount)).Value.ToString() + "; ";

        }

    }
}

只要我使用 treyresearch,net 用户从 adfsresources 域登录,它就可以工作。

如果我使用来自 adatum.com 域的 tokenappp url,我会收到一个错误,并且在 adfsresource 服务器的事件日志中我有这个错误:

Event code: 4011 
Event message: An unhandled access exception has occurred. 
Event time: 11/29/2011 7:20:26 PM 
Event time (UTC): 11/30/2011 1:20:26 AM 
Event ID: ac49318023ee4ba4ab7ab6e0bca78522 
Event sequence: 5 
Event occurrence: 2 
Event detail code: 0 

Application information: 
    Application domain: /LM/W3SVC/1/ROOT/adfs-1-129670890061718750 
    Trust level: Full 
    Application Virtual Path: /adfs 
    Application Path: C:\Windows\SystemData\ADFS\sts\ 
    Machine name: ADFSRESOURCE 

Process information: 
    Process ID: 1892 
    Process name: w3wp.exe 
    Account name: NT AUTHORITY\NETWORK SERVICE 

Request information: 
    Request URL: https://adfsresource.treyresearch.net:443/adfs/ls/clientlogon.aspx 
    Request path: /adfs/ls/clientlogon.aspx 
    User host address: 192.168.10.133 
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: NT AUTHORITY\NETWORK SERVICE 

Custom event details: 

这是否意味着我需要在 ADFS 信任之上获得 Windows 信任才能将 Windows NT 令牌用于远程域?如果是这样,那么拥有 ADFS 信任没有意义,如果我还需要拥有 Windows 域信任。

我可以让我的声明应用程序在远程域中正常工作,但是在所有信任策略导出导入完成后我添加了这个新的令牌应用程序 http://technet.microsoft.com/en-us/library/cc731103%28WS.10%29.aspx

我也关注并验证了以下信息 http://technet.microsoft.com/en-us/library/cc734929%28WS.10%29.aspx

【问题讨论】:

    标签: c# asp.net claims-based-identity adfs


    【解决方案1】:

    一个警告 - 您引用的那篇文章写于 2006 年并讨论了 Web 代理 - 换句话说,它是 ADFS 1。

    ADFS 2 几乎是一个新产品。 2010年出来的,已经没有代理的概念了。

    Windows Server 2008 标配的 ADFS“功能”是 1 而不是 2。您必须下载 2 并安装它。

    Appendix A: Reviewing AD FS 2.0 Requirements 声明“AD FS 2.0 不支持基于 Windows NT 令牌的应用程序。”

    不过,它确实支持 C2WTS(对 Windows 令牌服务的声明)。

    【讨论】:

    • 我确实安装了 ADFS 1.0,这就是我正在使用的东西
    • 好的 - 因为您将其标记为 adfs 2 而感到困惑。出于兴趣,您为什么安装 adfs 1 而不是 adfs 2?是因为NT代币服务吗?
    • 我是 adfs 的新手,所以我认为 server 2008 附带的是 adfs 的最新版本
    • 根据文档,不支持。如果它是必须具备的,那么您将不得不使用 ADFS 1.0。你看过 C2WTS 吗?这篇文章可能有帮助吗? theidentityguy.com/articles/2010/10/15/…
    • 有一段时间没有使用 C2WTS,但是是的,您需要创建他们所谓的“影子帐户”。谷歌就知道了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-01-09
    • 1970-01-01
    • 1970-01-01
    • 2013-10-01
    • 2021-04-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多