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

  • Home
  • SEARCH
  • 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 5998913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:28:23+00:00 2026-05-23T00:28:23+00:00

I have an application that is built in Java that requires authorization. However, the

  • 0

I have an application that is built in Java that requires authorization. However, the authentication piece is handled by a different/separate application (not in Java). The user logs in to the authentication app, and that app sets a cookie. If the user is authorized to access the Java app, they will be redirected by the authorization app to the Java app’s URL.

I want to use Spring Security to verify/check the cookie before allowing access to the Java application. What’s the best way to do this? The Java app should do below:

  1. check to see if cookie exists
  2. if cookie exists, validate cookie values with db. If not, send them to other app to login
  3. if cookie is valid, show application. If not, send user to “authentication” app.

Any ideas?

  • 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-23T00:28:24+00:00Added an answer on May 23, 2026 at 12:28 am

    You can do this by making your own UsernamePasswordAuthenticationFilter. Inside the filter you can check for the cookies you need. You should only need to override the attemptAuthentication() method. You have the request and response objects there so checking for the cookies should be easy.

    You will also need to implement a UserDetailsService to check the user credentials with the database.

    • This will help you on the custom filter.
    • This is how to write a UserDetailsService.

    Your namespace config should look something like this:

    <http use-expressions="true" auto-config="false" entry-point-ref="yourEntryPointInApp1">
    
        <custom-filter position="FORM_LOGIN_FILTER" ref="myFilter" />
    </http>
    <authentication-manager>
    
        <authentication-provider user-service-ref="myDetailsService" />
    </authentication-manager>
    

    Also be careful not to use <formLogin> if you decide to implement the filter.

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

Sidebar

Related Questions

I have an application that is built against OpenSceneGraph (2.6.1) and therefore indirectly OpenGL.
I have a custom application that was built to send opt-in newsletters and marketing
I have a Silverlight application that is built from a set of Silverlight class
I have an winforms application that was built using MVC. The controller is subscribing
I have a legacy VB6 application that was built using MSDE. As many client's
I have built an application that uses SQL Express 2005 and I want to
I have built a MS Access 2007 application that can create reports files in
I have built a windows C++ application that I'd like to port to linux.
I have built an application in C# that I would like to be optimized
I have an application, built using MVC, that produces a view which delivers summary

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.