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 5985439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:31:49+00:00 2026-05-22T22:31:49+00:00

I have a servlet application deployed on a tomcat 7.0 server (call it Server

  • 0

I have a servlet application deployed on a tomcat 7.0 server (call it Server A) . The app will take user’s credential and pass it to another server (Server B) to retrieve data.

Problem:

user Alice from machine 1 logged into Server A. Server A uses Alice’s credential to access Server B. getPasswordAuthentication () is used to pass Alice’s credential to Server B. Subsequently, user Bob from machine 2 logged into Server A. Server A will continue to use Alice’s credential to access Server B. I noticed that getPasswordAuthentication () is not invoked for user Bob.

Is there a way to force authentication every time when Server A tries to access Server B?
ps: If restart the tomcat on Server A, authentication will be performed for the first request to Server B after the restart.

Your feedback is greatly 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-22T22:31:50+00:00Added an answer on May 22, 2026 at 10:31 pm

    you need to explicitly clear the cache prior to access server b’s resources by using AuthCacheValue.setAuthCache(new AuthCacheImpl());

    This is because the credentials are cached by default and there is no configuration to specify caching behavior.

    import sun.net.www.protocol.http.AuthCacheValue;
    import sun.net.www.protocol.http.AuthCacheImpl;
    [....]
    AuthCacheValue.setAuthCache(new AuthCacheImpl());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WEB Application deployed in Tomcat. I would like to intercept all
I developed a Tomcat application using Tomcat 6 for testing. I have now deployed
I have a standard web application deployed to an application server. The application uses
I have a web service application that I deployed successfully on Apache Tomcat using
I have to connect to server(servlet on tomcat) always running and process the http
I have inherited a Java application (servlets) that runs under Tomcat. For historical reasons,
I have a server behind a firewall. It runs a web application (Java servlets
I have a servlet running in an Oracle OCCAS server. Currently I map some
In tomcat 6 i have a servlet running openbluedragon, everything compiles and servers up
I have a standard GWT application, and it of course uses a Java servlet

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.