Configuring single sign-on on Websphere 6.1.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rajesh_Gudikoti
Posted On:   Wednesday, December 26, 2007 05:45 AM

We are using single sign-on option for our web application. It was working fine with Websphere 5.1(running on Windows). Now we shifted our server to websphere 6.1 (running on Linux RHEL 4.0). On Websphere 6.1 the code written to implement single sign-on functionality is not working. It throws following exception 85UnuRqFoK_g3Z2ZE2SPtyF - Exception caught: java.lang.IllegalArgumentException: Illegal trailing EOL java.lang.IllegalArgumentException: Illegal trailing EOL at com.ibm.ws.genericbnf.impl.BNFHeadersImpl.checkHeaderValue(BNFHeadersImpl.java:4017) at com.ibm.ws.genericbnf.impl.BNFHeadersImpl.setHeader(BNFHeadersImpl.java:2615) The code written to implemen   More>>


We are using single sign-on option for our web application. It was working fine with Websphere 5.1(running on Windows). Now we shifted our server to websphere 6.1 (running on Linux RHEL 4.0). On Websphere 6.1 the code written to implement single sign-on functionality is not working. It throws following exception



			

85UnuRqFoK_g3Z2ZE2SPtyF - Exception caught: java.lang.IllegalArgumentException: Illegal trailing EOL
java.lang.IllegalArgumentException: Illegal trailing EOL
at com.ibm.ws.genericbnf.impl.BNFHeadersImpl.checkHeaderValue(BNFHeadersImpl.java:4017)
at com.ibm.ws.genericbnf.impl.BNFHeadersImpl.setHeader(BNFHeadersImpl.java:2615)



The code written to implement single sign-on functionality is below:

			

try{
String auth = request.getHeader("Authorization");

if (auth == null) {
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
response.setHeader("WWW-Authenticate", "NTLM");
response.flushBuffer();
return mapping.findForward("");
}
if (auth.startsWith("NTLM ")) {
byte[] msg = new sun.misc.BASE64Decoder().decodeBuffer(auth.substring(5));
int off = 0, length, offset;
String s;

if (msg[8] == 1) {
off = 18;

byte z = 0;
byte[] msg1 = {(byte)'N', (byte)'T', (byte)'L', (byte)'M', (byte)'S', (byte)'S', (byte)'P', z,
(byte)2, z, z, z, z, z, z, z,
(byte)40, z, z, z, (byte)1, (byte)130, z, z,
z, (byte)2, (byte)2, (byte)2, z, z, z, z,
z, z, z, z, z, z, z, z};

response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
response.setHeader("WWW-Authenticate", "NTLM " + new sun.misc.BASE64Encoder().encodeBuffer(msg1));
return mapping.findForward("");
} else if (msg[8] == 3) {
off = 30;
length = msg[off+17]*256 + msg[off+16];
offset = msg[off+19]*256 + msg[off+18];
s = new String(msg, offset, length);
} else{
return mapping.findForward("");
}


length = msg[off+1]*256 + msg[off];
offset = msg[off+3]*256 + msg[off+2];
s = new String(msg, offset, length);
length = msg[off+9]*256 + msg[off+8];
offset = msg[off+11]*256 + msg[off+10];
s = new String(msg, offset, length);
StringBuffer ntUser = new StringBuffer();
for(int i=0; i
if(i%2 ==0){
ntUser.append(s.charAt(i));
}
}
ntUserstr = ntUser.toString().trim();
}
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);





I went through the website and found info related to Single sign-on for HTTP requests using SPNEGO. But still i could not resolve my problem. Please one help me.

   <<Less

Re: Configuring single sign-on on Websphere 6.1.

Posted By:   Christopher_Koenigsberg  
Posted On:   Thursday, January 24, 2008 11:14 PM

Maybe you need to check the end of your "auth" string for EOL (End Of Line) characters, and strip them off if found? Carriage Return, and/or Linefeed
About | Sitemap | Contact