单点登录之External Authentication for Non-embedded Agent

此种单点登录模型中涉及三个角色

  • End User's Client (A)
  • Portal Web Server with Portal Application (B)
  • Web Server Farm (C)

以上A是客户终端,B是入口服务器,类似于代理,所有的客户请求都会经过B,B再发送请求至C

现在C的通过验证策略是将B加入他的ACL(Access Control List),再只要发给他的请求中带有合法的用户名参数,

就会予以认证通过,现在的问题是普通的通过B,如链接或转发(sendRedirect)出去的请求C不认可来自ACL,应该怎么办呢?具体的Web Server Farm可能有具体的策略应对,一例:

 

// the following part is to send request and then get the 'Location'
// in the response, redirect it to the user client
try {  
    URL url = new URL(urlString);  
    // allow redirection
    HttpURLConnection.setFollowRedirects(false);  
    HttpURLConnection urlConnection = (HttpURLConnection)url.openConnection();  
    urlConnection.setDoOutput(true);  
    // put parameters
    OutputStreamWriter wr = new OutputStreamWriter(urlConnection.getOutputStream());  
    wr.write("userId=" + userID + "@" + compID);  
    wr.flush();  
    wr.close();  
    urlConnection.connect();  
    // get header information
    String location = urlConnection.getHeaderField("Location");
    urlConnection.disconnect();
    System.out.println("location = " + location);
    if(location != null) {  
        response.sendRedirect(location);
    }
} catch (Exception e) {  
    e.printStackTrace();  
}

 

如上代码所见,如果不去获取Header Location的话,客户端貌似没办法获得合法的转向(redirection),当然也就没有正确的反馈了

 

为什么点B上的链接也算是源自客户端A的请求?

答:姑且认为点一个链接就是客户端的转向吧

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值