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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:46:04+00:00 2026-05-20T19:46:04+00:00

I’m a reasonably new user of Spring Security. I previously configured Spring Security to

  • 0

I’m a reasonably new user of Spring Security.

I previously configured Spring Security to perform form based authentication for my web app.

I’ve used Annotations to indication which Controllers/Methods require ROLE_USER vs anonymous, and implemented my own daoAuthenticationProvider to perform the authentication.

I am now implementing REST services which need to authentication on BasicAuthentication + do an IP verification to my DB.

So I have a new role ROLE_IP_AUTH which I’ve defined on the REST services controller.

I’m just a little overwhelmed at this point. Can someone give me a brief description of what next step I should take?

  • Do I need to create a new
    <security:http> element for the new
    role?
  • Should I be switching to this
    FilterChainProxy? If so what filters
    should I include?
  • Should I just handle this in my existing daoAuthenticationProvider class?

Basically I just need to know what direction I’m going in. I think I know enough to get there, there’s just 5 different ways to get anywhere in Spring it seems.


Additional Information
My current implementation has the element configured as follows:

<security:http auto-config="false"
               entry-point-ref="authenticationEntryPoint" >
    <security:logout logout-url="/logout" />
    <security:anonymous enabled="false"/>
    <security:custom-filter position="FORM_LOGIN_FILTER" ref="usernamePasswordAuthenticationFilter" />
    <security:custom-filter position="ANONYMOUS_FILTER" ref="anonymousAuthFilter" />
</security:http>

My remaining question is how I can implement my own IP validation. I can just add the BasicAuth filter using custom-filter and implement my own basic auth filter which checks the IP. But I’m fuzzy on how I make that filter only applicable for the ROLE_IP_AUTH being used by my REST services?

  • 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-20T19:46:05+00:00Added an answer on May 20, 2026 at 7:46 pm

    The answer by @Ritesh has been very helpful in re-framing this questing in a different way. Another great post that addresses this question is here:

    Spring security – how to mention both form based and basic authentication

    Ultimately my understanding is: do it via voters as @Ritesh suggests in 3.0.x, or use multiple <http … /> elements as is now available in 3.1.0.RC1 (version as of 17mar2011) as discussed in the link above.

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

Sidebar

Related Questions

No related questions found

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.