Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6092911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:29:59+00:00 2026-05-23T12:29:59+00:00

I am trying to open this uri https://some-host/a/meta? (this url is passed to proxi.jsp

  • 0

I am trying to open this uri

https://some-host/a/meta?  (this url is passed to proxi.jsp page)

.. but it redirects to authentication service (on https) which popups a box for username and password…and if on browser.. it then needs you to key-in the credentials.. and it then comes back to the first link i was trying to open and shows the content… so i want to know that when this intermediate redirect to authentication service happens.. how do i enter my username and password to that popup through code.. I am trying to use apache HttpClient to do this…

This is my proxi.jsp code which is making the request..

<%@ page language="java" import="
java.util.Collection,
org.apache.commons.httpclient.HttpClient,
org.apache.commons.httpclient.UsernamePasswordCredentials,
org.apache.commons.httpclient.auth.AuthScope,
org.apache.commons.httpclient.methods.GetMethod"
contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>

<%
try {
String a_Url = request.getParameter( "url" ) ;

HttpClient client = new HttpClient();
client.getState().setCredentials(
    new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT, "realm"),
    new UsernamePasswordCredentials("test", "pass")
);

GetMethod get = new GetMethod(a_Url);
get.setDoAuthentication( true );
try {
    int status = client.executeMethod( get );
    out.println(status + "\n" + get.getResponseBodyAsString());
} finally {
     get.releaseConnection();
}
} catch (Throwable t) {
    t.printStackTrace();
}   

%>

And this is the error I am getting:-

org.apache.commons.httpclient.InvalidRedirectLocationException: Invalid redirect
 location: https://login.xyz.com/13/smt
d.scc?TYPE=16&REALM=-SM-Documentum%20
uGVx6wOk1daI3&TARGET=-http%3A%2F%2Fsome-hid%3D10
        at org.apache.commons.httpclient.HttpMethodDirector.processRedirectRespo
nse(HttpMethodDirector.java:619)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMe
thodDirector.java:179)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav
a:397)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav
a:323)
        at org.apache.jsp.proxi_jsp._jspService(org.apache.jsp.proxi_jsp:64)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:389)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:4
86)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511
)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:3
90)
        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.jav
a:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:1
82)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:7
65)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)

        at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327)
        at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
        at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(Normal
RewrittenUrl.java:213)
        at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.j
ava:171)
        at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:14
5)
        at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewri
ter.java:92)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewrit
eFilter.java:381)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
Handler.java:1157)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainI
nvocation.java:67)
        at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilte
rPipeline.java:122)
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:110)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
Handler.java:1157)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:3
88)
        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.jav
a:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:1
82)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:7
65)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)

        at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHand
lerCollection.java:230)
        at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.
java:114)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:1
52)
        at org.mortbay.jetty.Server.handle(Server.java:326)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:53
6)
        at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpCo
nnection.java:915)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
        at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.ja
va:409)
        at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.j
ava:582)
Caused by: org.apache.commons.httpclient.URIException: Invalid query
        at org.apache.commons.httpclient.URI.parseUriReference(URI.java:2049)
        at org.apache.commons.httpclient.URI.<init>(URI.java:147)
        at org.apache.commons.httpclient.HttpMethodDirector.processRedirectRespo
nse(HttpMethodDirector.java:601)
        ... 44 more

And If I try to paste this url

https://login.xyz.com/9]&AUTHREASON=0&METHOD=GET@Name

back on the browser then I get a pop up window for authentication and If I write my username and password in that window then I get the actual content that I am looking for.
Is there any header that I have to pass in proxi.jsp page. Because passing username and password in the page is not the best way to do it..Or any other way. Any suggestions will be appreciated..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:30:00+00:00Added an answer on May 23, 2026 at 12:30 pm

    You must be using HttpClient 3.1, since my testing indicates that HttpClient 3.0 is fine with that URL. HttpClient 3.1, however throws an error when it gets to the [ in the query string. Why that is the case I am not sure. According to RFC 3986 both [ and ] should be allowed. Looking at the URI source in HttpClient 3.1 it doesn’t include those characters for some reason. This is possibly a bug in that version I would say. That being said, I don’t think there is any work going into HttpClient 3.x since 4.x is now the focus.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to parse a webpage using open-uri + hpricot but it seems to
I'm trying to get a url using open-uri. my code is outrageously simple url
I got this error today when trying to open a Visual Studio 2008 project
recently I downloaded this open source project and I am trying to compile it.
I'm trying to open a pop-up menu from a NSToolbarItem. I tried following this
This .NET API works OK if I'm trying to open the Registry in a
All of a sudden I start getting this error while trying to open 2
I'm trying to solve this flickering problem on the iphone (open gl es game).
I am trying open a new window using url.Action. And the new Window url
Here's a sample of some oddness: #!/usr/bin/ruby require 'rubygems' require 'open-uri' require 'nokogiri' print

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.