Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Security For my web-application  RSS feed

 
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
Posts: 42970
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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!