Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Spring Rest prevent access except for specific url  RSS feed

 
Mark Case
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I need to prevent all access to a java spring rest service, except for request made from specific url.  antMatchers don't seem to address this type of situation.

I would appreciate it anyone could point me into the right direction.

Thanks
 
Ankit Garg
Sheriff
Posts: 9610
37
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you say "from specific url" what does that mean? Generally you check request based on IP address they are coming from. A URL cannot request another URL technically. You can use referer header but I wouldn't recommend that as it can be easily set to anything...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!