0

Within the web.xml of a Java EE Servlet Container (Tomcat, Glassfish etc.) I can set a security constraint to restrict the access to a certain resource.

Is it possible to make a distinction between access from localhost and all the others? I want to enable authentication in a glassfish server for all external calls to a webapp but not from localhost. Is that possible?

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
Andreas
  • 707
  • 1
  • 6
  • 23

1 Answers1

0

Put this in your /META-INF/context.xml:

<Context>
    <Valve className="org.apache.catalina.valves.RemoteAddrValve" deny="127\.0\.0\.1"/>
</Context>
unwichtich
  • 13,712
  • 4
  • 53
  • 66