首页 新闻 会员 周边 捐助

MOSS2010中使用SSO问题

0
[待解决问题]

MOSS2010中使用SSO来做单点登录,如何以管理的身份,根据appId和指定一个域账号,去取出该账号所设置的业务系统的登录和密码????

请高手们指点,很急.!!!!!!!!!!!!!!!!!!!!!!!!!!!
幽境仼孓的主页 幽境仼孓 | 初学一级 | 园豆:0
提问于:2012-11-12 09:33
< >
分享
所有回答(1)
0

没完全明白

1,sso 你已经配置好了,就缺获取的密码和用户名的方法?

下面代码修改一下,就可以,

原文地址:http://www.ibeifeng.com/tech.php?id=60015

protectedvoid Button1_Click(object sender, EventArgs e)
{
  
string m_userName =string.Empty;
  
string m_password =string.Empty;
  
string m_html =string.Empty;
  
string m_appId ="163Mail";
   SecureStoreProvider m_provider
=new SecureStoreProvider();
   SPSite m_site
= SPContext.Current.Site;
   SPServiceContext m_serviceContext
= SPServiceContext.GetContext(m_site);
    m_provider.Context
= m_serviceContext;
   
try
    {
        SecureStoreCredentialCollection m_sscc
= m_provider.GetCredentials(m_appId);
       
foreach (SecureStoreCredential ssc in m_sscc)
        {
           
switch (ssc.CredentialType)
            {
               
case SecureStoreCredentialType.Generic:
                   
break;
               
case SecureStoreCredentialType.Key:
                   
break;
               
case SecureStoreCredentialType.Password:
                    m_password
= ToClrString(ssc.Credential);
                   
break;
               
case SecureStoreCredentialType.Pin:
                   
break;
               
case SecureStoreCredentialType.UserName:
                    m_userName
= ToClrString(ssc.Credential);
                   
break;
               
case SecureStoreCredentialType.WindowsPassword:
                   
break;
               
case SecureStoreCredentialType.WindowsUserName:
                   
break;
               
default:
                   
break;
            }
        }
        m_html
+="<script>";
        m_html
+=string.Format("window.location.href='http://reg.163.com/login.jsp?url=&type=1&product=&savelogin=&outfoxer=&domains=&syscheckcode=4ecd8fe3803494cff0df5414f321fd5f9afa4c78&username={0}%40163.com&password={1}&Submit='", m_userName, m_password);
        m_html
+="</script>";
        Response.Write(m_html);
    }
   
catch (Exception ex)
    {
        Response.Write(
"<script>window.location.href= '/_layouts/SecureStoreSetCredentials.aspx?TargetAppId="+ m_appId +"';</script>");
    }
}

小吕哥^_^ | 园豆:195 (初学一级) | 2013-04-02 13:52
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册