• SharePoint 2010集成Window Live认证1


    使用live id作为sharepoint 的登录数据提供方,确实不是一件容易的事件,因为这会让我们的场景变成了面对公共网络的网站,当然也能应用内网。当然,我们不再需要去维护密码和用户注册等。
     
    对于sharepoint 2007,没有什么本地化的支持,不过据说在网上有一些登录的代码:http://spwla.codeplex.com,但是2010已经有了本地的声明访问,所以有了本文。
     

    Background

    背景:

    这里需要详细介绍一下背景,我们需要理解window live ID结合基于身份验证访问方式。 

    首先,声明的验证方式基于简单的场景, 

    尝试访问 网站的客户端/用户(也叫做依赖方/RP), 

    RP访问分布式的信任方(身份提供方IP), 

    在我们的例子里面SharePoint=RP,Live ID=IP, 

    当然个体用户就是主题(subject),当subject尝试访问RP,subject将会跳转到IP(这是一个实际的登录过程发生的地方)。身份提供方也就是live网站附加上cookies到输出流,并且带用户跳到RP(SharePoint),这其中也有一个进行验证加密,以供RP可以最后验证这个用户。想要知道更多,就去看A guide to Claims-based Identity and Access Control.

    不过我们看看图,会更清楚点:

    image.png

    Window Live ID(WLID) 比较关心的是登录和发送一个唯一标识ID给SharePoint网站。这个唯一标识ID就是整个验证能给到你的东西了。不幸的是,你不可以拿到正确的邮件地址或者是用户名字。moss首先验证这个加密安全token.

     

    另一重要的事是,WLID有两区域:INT和PROD,PROD指我们正常使用的,INT是用户开发测试的。所以我们先在INT测,你没法跳过INT,你得先注册你的网站,再去PROD区域。

    注册网站

     
    在你开始配置Sharepoint 网站之前先注册你要用于Window LIVE ID登录的网站。下面就是网址:http://msm.live.com/. 这里用正常的LIVEID登录。
     

    image.png

      你会得到一个确认画面,点YES 确认并继续: 
     
    image.png
     
     
    几秒后你就看到结果啦,如果一切正常,继续下面:
     

    image.png

    打开Go to Manage Your Site 链接
     Modify Editable Site Properties  
     
    image.png 
     
    打开高级属性:
     
    image.png
     
     
    修改Domain name :你的网站域名,如果是开发机,可以是你的服务器名啦。如:extranet.corp.local
    DNS name (2) with a URN,比如: urn:wictorslivesite:int
    Default Return Url (3);比如 https://extranet.corp.local/_trust/default.aspx. 这个网址是MSM回发的网址, 要写好,不然找不到你的网站,只要把extranet.corp.local改成你的就可以了
     Expire Cookie URL (4). 这是cookies失效页面,你可以按图写着,以后,你自己弄个失效页面换了它。
     
    image.png
     
    在 Override Authentication Policy, 这步很关键:
    选择 MBI_FED_SSL 然后点提交。
     
    image.png
    接下来确认页面:
    image.png
     
    恭喜发财页面:
     
    image.png
     
     
    好了,这部分结束了,请移步到SharePoint那边
     
     
    证书:基于声明验证的关键就是证书,没有证书SharePoint没法信任Live ID
    基于声明验证使用证书来进行加密签名,你需要信任提供方发布的证书装在你的MOSS服务器上。
    主要有几个步骤:
     
    下面给出一个爆发性链接:猛击:https://nexus.passport-int.com/federationmetadata2/2007-06/federationmetadata.xml 当然,你不是真的证书,因为它是用于测试的。
    复制X509Certificate 里面的部分,注意不要包括X509Certificate ,保存在记事本中,名称:LiveID-INT.cer。再次确定你只是拿了X509Certificate里面那部分。
     
     
    有图有真相:
    image.png
     
     
    先打开mmc.exe,文件--添加操作或管理单元,实际上你需要导入到服务器的三个地方:直接看图箭头指示
    image.png
     
    把证书导入到这三个地方就可以了。
     

    To create the Trusted Identity Token Issuer, that we will use to configure as the login provider for the Web Applications, we fire up PowerShell. This step will not be that "visual" as the previous ones, since none of these commands can be run using the standard SharePoint user interface. I guess it's just a matter of time until someone makes a neat add-on with these simple commands...

    I'll give you the script first and then explains all the involved steps:

    接下来要创建 Trusted Identity Token Issuer, MOSS2010的验证机制啦。

    这个东西创建就是为了给我们后面的应用程序登录用的。打开的PowerShell,把下的脚本跑一下:能不能成功看人品吧,反正我没成功,后来改了一下,就可以,人品还是需要考验啊。

    1: asnp microsoft.sharepoint.powershell
    2: $realm = "urn:wictorslivesite:int"
    3: $certfile = "C:\Temp\LiveID-INT.cer"
    4: $rootcert = Get-PfxCertificate $certfile
    5: New-SPTrustedRootAuthority "Live ID INT Root Authority" -Certificate $rootcert
    6: $emailclaim = New-SPClaimTypeMapping 
    -IncomingClaimType "http://schemas.xmlsoap.org/claims/EmailAddress"
    -IncomingClaimTypeDisplayName "http://schemas.xmlsoap.org/claims/EmailAddress"
    -SameAsIncoming 7: $upnclaim = New-SPClaimTypeMapping
    -IncomingClaimType "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"
    -IncomingClaimTypeDisplayName "UPN"
    -LocalClaimType "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn" 8: $authp = New-SPTrustedIdentityTokenIssuer -Name "LiveID INT"
    -Description "LiveID INT" -Realm $realm -ImportTrustCertificate $certfile
    -ClaimsMappings $emailclaim,$upnclaim -SignInUrl "https://login.live-int.com/login.srf"
    -IdentifierClaim "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"
     asnp 是 Add-PSSnapin的缩写
    设置你的realm : DNS Name (that is the URN), 
    certfile 指向你的 LiveID-INT.cer
     
    这样就向SharePoint添加 根验证证书了,
     
    image.png
     
    创建你的站点:

    image.png
     
     
    image.png
     
     
    image.png
     
    创建网站集
     
    创建网站的自签名证书
    image.png
    image.png
     
    绑定证书
    image.png
     
    image.png
     
    image.png
     
    image.png
  • 相关阅读:
    leetcode 14 Longest Common Prefix
    leetcode 20 Valid Parentheses 括号匹配
    leetcode 67 Add Binary
    ios swift 实现饼状图进度条,swift环形进度条
    【设计总结】DiDi
    【交互】退出弹窗思考
    【交互】导航栏设计
    【插件】Office
    【算法】聚类评价指标
    【Math】PCA与LDA
  • 原文地址:https://www.cnblogs.com/sunjunlin/p/2327328.html
Copyright © 2020-2023  润新知