SharePoint 开发实录:3,SSO不同解决方案

[size=medium][b]方案:[/b][/size]

方案 1,使用AD方式,启动 服务 中SSO服务,使用SSO credential.

方案 2,使用form方式登陆sharepoint,好处是独立于AD之外,可以被互连网的用户访问。该方案可以通过查询数据库获取密码的明码、hashed password、encrypted password,将密码传给第三方的系统,进行集成单点登陆。


[size=medium][b]已完成:[/b][/size]
[b]一、通过在webpart中嵌入JS实现了功能4、5。[/b]
功能4, webpart生成超连接,而不是按钮式的点击。
功能5,webpart在新窗口中打开连接。
相关代码:

string script;

script = @"<script language=javascript>

//your javascript here
function openWindowJS(basedUserNameJS,basedUrlJS){

var wholeURL = location + '?decryptAction=' + decryptAction
+ '&j_username=' + basedUserNameJS + '&url=' + basedUrlJS;
//open page within new window
window.open(wholeURL,'','location=no,resizable=yes'); //'http://www.google.com'
//open page within original window
//window.location.href=wholeURL;
}

</script>";

output.Write(script + "<a href='javascript:openWindowJS(\"" + basedUserName + "\",\"" + basedUrl + "\");'>Test 01</a>"
+ "<br>";


[b]功能3, webpart获取发出的httpRequest的响应内容[/b]
相关代码:

public static String processResponse(String url)
{
// Creates an HttpWebRequest with the specified URL.
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
// Sends the HttpWebRequest and waits for the response.
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
// Gets the stream associated with the response.
Stream receiveStream = myHttpWebResponse.GetResponseStream();
Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
// Pipes the stream to a higher level stream reader with the required encoding format.
StreamReader readStream = new StreamReader(receiveStream, encode);
Console.WriteLine("\r\nResponse stream received.");
Char[] read = new Char[256];
// Reads 256 characters at a time.
int count = readStream.Read(read, 0, 256);
//Console.WriteLine("HTML...\r\n");

StringBuilder outStr = new StringBuilder(4000);
while (count > 0)
{
// Dumps the 256 characters on a string and displays the string to the console.
String str = new String(read, 0, count);
outStr.Append(str);
//Console.Write(str);
count = readStream.Read(read, 0, 256);
}
//Console.WriteLine("");
// Releases the resources of the response.
myHttpWebResponse.Close();
// Releases the resources of the Stream.
readStream.Close();
return outStr.ToString();

}


[b]功能6, 取消分给用户的webpart的使用权限后,再验证webpart对用户是否还有使用权限限制。[/b]
webpart可以在不分给用户特定的使用权限的情况下,被用户在页面中使用。


[size=medium][b]需要改进:[/b][/size]
webpart中嵌入form以post方式提交http请求,隐藏url中的参数。

需要作测试的内容
1,使用AD方式,启动 服务 中SSO服务,使用SSO credential.
2,webpart连接oracle
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值