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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:08:57+00:00 2026-05-26T17:08:57+00:00

I have a REST web service using spring MVC which is external-facing. I would

  • 0

I have a REST web service using spring MVC which is external-facing.
I would like to restrict access to some REST calls for admin usage and for other servers on the same internal network to call.

So far I can think of the following solutions:

  1. Use Spring-Security to restrict a mapping to a subnet using “hasIpAddress” access
  2. Separate the sensitive REST calls into their own controller and Write an AOP pointcut which reads the HttpServletRequest for the IP address and check against a whitelist

I’m not fond of either solution. (1) doesn’t give me enough flexibility, I may be on several subnets, and may only want to open up an IP range. (2) Gives me nearly exactly what I want but it seems hacky, there must be a better way to do this.

  • 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-26T17:08:58+00:00Added an answer on May 26, 2026 at 5:08 pm

    (2) why do you not want to use the “standard” annotations like @PreAuthrize. You can put them at the methods, so you do not need to move the sensitive REST methods to an other controller.

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

Sidebar

Related Questions

I have written a service that I would like expose both via rest and
We are currently using Spring MVC to implement REST web services. We now want
I'm using eclipse and I have a java web service (rest jax-rs) I also
I'm creating a REST web service using spring and I need to implement login/logout
We have a Spring web application created using Spring MVC 3.0 In the same
I have created a REST web service using WCF and use HTTP Post Method.
We have created RESTful web services using Spring's REST support. We need to call
I want to build a REST web service on app engine. Currently i have
I have a web service class that the rest of the framework depends on
I have some REST web services implemented in WCF. I wish to make these

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.