Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Security For my web-application

 
Sarath Koiloth Ramath
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I need my web-application to be accesses from certian Ip addess.How can i acheive this ?

Thank in advance

 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HttpServletRequest.getRemoteAddr returns the IP address from where the request originates. You can compare that with the list of approved addresses, and return an error (maybe 403 - SC_FORBIDDEN) if it's not in that list.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course, IP addresses are fairly easy to spoof, so if you want real security, you can't rely on the client's TCP/IP address.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic