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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:42:08+00:00 2026-06-11T09:42:08+00:00

I am developing two web applications where one is a server app and the

  • 0

I am developing two web applications where one is a server app and the other is a client app, both are using Spring Security. My use case is such that after a user logs into the server app, the user can then access the client app from links within the server app. Since the user should not have to log in again when they click on these links (part of my requirements), I decided to use a strategy similar to Single SignOn in order to forward their authentication information from the server app to the client app.

On the client app, I am using Spring Security’s RequestHeaderAuthenticationFilter to look for a custom request header that is set by the server app.

  1. If this custom header is found, do I have to do any further validation that this request is trustworthy? In Spring’s Pre-Authentication doc, RequestHeaderAuthenticationFilter does not perform any authentication and will assume the request to be from the user specified in the SM_USER attribute. How do I ensure that the request is genuine?

  2. How do I send the user from one app to another with a custom header in the http request? Redirecting the request does not work as the header information will be lost. Forwarding does not work as the forwarded request does not go through the configured Spring Security filters on the client app, thus the request is never “authenticated” and no session is created.

  • 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-06-11T09:42:09+00:00Added an answer on June 11, 2026 at 9:42 am

    Since I didn’t receive any responses, I changed my approach slightly in order to achieve the same SSO behavior. I am answering my own question here to close this issue.

    Instead of using the RequestHeaderAuthenticationFilter, I subclassed Spring’s AbstractPreAuthenticatedProcessingFilter which retrieves the Principal and Credentials from the HttpRequest. I then implemented a custom preAuthenticatedUserDetailsService that will validate the Credentials with the server app before loading the UserDetails.

    As for #2, I am no longer using custom headers in the initial pre-authenticated login request. I am simply appending the principal (username) and credentials as url parameters to the initial pre-authenticated “login” request to the client app. Since the communicated between the two apps are secured via SSL, I figured that should be safe.

    This is what my security configuration looks like now:

    <b:bean id="http403EntryPoint" class="org.springframework.security.web.authentication.Http403ForbiddenEntryPoint" />
    <b:bean id="navigatorPreAuthFilter" class="com.example.NavigatorPreAuthenticatedProcessingFilter">
        <b:property name="authenticationManager" ref="authenticationManager" />
    </b:bean>
    
    <http auto-config="false" entry-point-ref="http403EntryPoint">
    
        <custom-filter position="PRE_AUTH_FILTER" ref="navigatorPreAuthFilter" />
        <session-management session-fixation-protection="newSession" />
        <logout logout-success-url="/logout" delete-cookies="JSESSIONID" />
    
        <intercept-url pattern="/index.jsp" access="ROLE_QUESTIONNAIRE_ASSIGNEE"/>
    </http>
    
    <b:bean id="preAuthenticatedUserDetailsService" class="com.example.NavigatorPreAuthenticatedUserDetailsService" />
    <b:bean id="preauthAuthProvider" class="org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider">
        <b:property name="preAuthenticatedUserDetailsService" ref="preAuthenticatedUserDetailsService" />
    </b:bean>
    
    <authentication-manager alias="authenticationManager">
        <authentication-provider ref="preauthAuthProvider"/>
    </authentication-manager>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a web app that will have two parts running on two
I'm developing two Ruby gems, one is a framework, the other is an application.
I am developing one web application using CakePHP , I will be providing one
I'm developing an example web-application, using JPA 2.0 entities, Hibernate 3.6.2 and Spring 3.
my background: i've been developing web applications using php and javascript for the past
I am developing a web application using JSF and JPA(Eclipse link). I have two
I am currently developing a jsp web application that maintains two clients of two
I'm new to magento. Currently i'm developing two ecommerce sites using multi-store option in
I'm developing a menu that has two modes, when the user clicks on one
I am developing a Java EE web application using Struts. The problem is with

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.