thanks for the response. I am checking now.
Main Topics
Browse All TopicsI have to set a value in the http header and I know how to do this in a servlet but I'm not sure how to do so in a JSP. I am basically trying to implement Single Sign On within a product called Vignette. I control what is passed to the Vignette proxy server (TAS) URL. I have attached the TAS class that handles authentication into Vignette. It is called HttpUserNameCallback. Save the file as .java Please just refer to the getUserName() method in this class as it is called first. I tried to post the variable sm_user within a form post in JSP (below). This does not work. I've been instructed that sm_user must be present in the HTTP REQUEST HEADER. I'm not sure how to do so. My JSP code is below. Please help!!! I've been at this for 3 1/2 weeks and I'm finally at the end but need to cross the line here.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I'm not sure how this example is helpful. I understand what TAS (which interfaces with SiteMinder) is doing in the getUserName method. My question is how to set a header name of "SM_USER" in the HTTP REQUEST. I would like to do so from my JSP but if this isn't possible, I need guidance on how to accomplish this in a Java Servlet that I can call from my JSP.
I think I can use the response.setHeader("name",
but I'm not sure if this will work. I'm basically trying to simulate what SiteMinder would do if it was sending a request to TAS (Trusted Authentication Service) but again, I need to do so from a JSP page or a servlet. My JSP is basically reading a cookie that was set by our SSO (Single Sign On) service.
I can call it anything I want. It doesn't have to be "sm_user". I was just doing this so I wouldn't have to write a new class that extends the current HttpUserNameCallback class and looks for my attribute name instead of "sm_user". I can do this however. It's no big deal.
The question is whether or not it's possible to set a custom header in a JSP and then forward the Request object to a different page or URL. I know that the HttpUserNameCallback class will be called when the TAS URL request is made and it's currently looking for a username value (below). What can I do if I need to send the userName value in a header to the TAS URL?
public String getUserName(HttpServletReq
throws RemoteDataException
{
if(useIdentifier)
{
String identifierHeaderCheck = request.getHeader(identifi
if(identifierHeaderCheck != null && identifierHeaderCheck.equa
LOG.debug("Identifier passed security check");
else
throw new RemoteDataException("user_
}
String userName = request.getHeader(userName
if(userName == null)
userName = request.getRemoteUser();
LOG.debug("Getting " + userName + " from the request");
return userName;
}
Do you think the following article might help?
http://www.experts-exchang
You cannot add attributes to the HTTP headers in jsp or servlets. But filters could help to override it.
See this http://www.theserverside.c
So let me ensure I understand, within my JSP, I will still retrieve the cookie value I need but I will make a call to a filter class that will allow me to set a custom HTTP Header and then redirect to the TAS URL. How will I obtain this value?
Please understand the flow. Our SSO application will only redirect to a JSP page after authenticating a user and setting a cookie. It will not pass anything or create a header. It is up to me within the JSP to obtain the value I need from the cookie and then redirect to the TAS URL with the necessary variable in the HTTP REQUEST HEADER. Since you're saying I can't do this directly within the JSP, it sounds like I need to create a filter class that is called from my JSP and within this class, I need to set a header and then redirect to the TAS URL.
Does this sound correct?
The following reference is essentially what I'm attempting to do:
http://www.coderanch.com/t
Business Accounts
Answer for Membership
by: MuraliKanthPosted on 2009-04-06 at 18:30:56ID: 24083323
http://www.experts-exchang e.com/Soft ware/Serve r_Software / Web_Serve rs/ColdFus ion/Q_2346 4624.html
Check this solution
-Murali*