我正在使用 SSO(Oracle 访问管理器(OAM))实现 COGNOS 自定义身份验证提供程序(Java)。
OAM 的工作方式是在每个 HTTP/HTTPS 请求中查找有效会话令牌 Cookie,如果找不到,它会重定向到 OAM 登录页面。
如果 cookie 有效/授权,它还会添加一个 HTTP HEADER 并在其中设置用户名并重定向到 Cognos URL。Cognos 现在将此调用发送到自定义身份验证提供程序。
现在我的问题是我无法在自定义身份验证提供程序中读取此标头值。我尝试添加一个 ASP 页面,它可以读取值,这证明值正在被传递,并且它们是我在 CAP Java 代码中执行此操作的方式的一些问题。
我正在尝试使用的代码片段。
注意:我可以很好地获取 cookie,但所有标题始终为 NULL。注意2:我尝试过同时使用 INamespaceAuthenticationProvider/IBiBusHeader 和 INamespaceAuthenticationProvider2/IBiBusHeader2
public class CAPClass extends Namespace
implements INamespaceAuthenticationProvider
{
private String GetSingleValue(String[] value)
{
if(value != null && value.length > 0)
return value[0];
else
return null;
}
public void createLogs(String var, IBiBusHeader theAuthRequest)
{
CreateLog.LogMsg(var + ": " + GetSingleValue(theAuthRequest.getEnvVarValue(var)));
CreateLog.LogMsg(var + ": " + GetSingleValue(theAuthRequest.getTrustedEnvVarValue(var)));
CreateLog.LogMsg(var + ": " + GetSingleValue(theAuthRequest.getCredentialValue(var)));
//CreateLog.LogMsg(var + ": " + GetSingleValue(theAuthRequest.getTrustedCredentialValue(var)));
}
public IVisa logon(IBiBusHeader theAuthRequest)
throws UserRecoverableException, SystemRecoverableException,
UnrecoverableException
{
String var = "ObSSOCookie";
String SessTok = GetSingleValue(theAuthRequest.getCookieValue(var));
CreateLog.LogMsg(var + ": " + SessTok);
var = "REMOTE_USER";
createLogs(var, theAuthRequest);
var = "HTTP_REMOTE_USER";
createLogs(var, theAuthRequest);
var = "HEADER_REMOTE_USER";
createLogs(var, theAuthRequest);
var = "HEADER_HTTP_REMOTE_USER";
createLogs(var, theAuthRequest);
var = "HTTP_HEADER_REMOTE_USER";
createLogs(var, theAuthRequest);
var = "SSO_LOGIN_ID";
createLogs(var, theAuthRequest);
var = "HTTP_SSO_LOGIN_ID";
createLogs(var, theAuthRequest);
var = "HEADER_SSO_LOGIN_ID";
createLogs(var, theAuthRequest);
var = "HEADER_HTTP_SSO_LOGIN_ID";
createLogs(var, theAuthRequest);
var = "HTTP_HEADER_SSO_LOGIN_ID";
createLogs(var, theAuthRequest);
var = "OAM_REMOTE_USER";
createLogs(var, theAuthRequest);
var = "HTTP_OAM_REMOTE_USER";
createLogs(var, theAuthRequest);
var = "HEADER_OAM_REMOTE_USER";
createLogs(var, theAuthRequest);
var = "HEADER_HTTP_OAM_REMOTE_USER";
createLogs(var, theAuthRequest);
var = "HTTP_HEADER_OAM_REMOTE_USER";
createLogs(var, theAuthRequest);
}
}