Skip to content

Instantly share code, notes, and snippets.

@tomdwaggy
Last active August 29, 2015 14:17
Show Gist options
  • Save tomdwaggy/3e4b813453451713bcf5 to your computer and use it in GitHub Desktop.
Save tomdwaggy/3e4b813453451713bcf5 to your computer and use it in GitHub Desktop.
allow-anonymous-basic-auth
<snippet>
<security-constraint>
<web-resource-collection>
<web-resource-name>RequireAuthentication</web-resource-name>
<description>Secured page for forcing the container to request login</description>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>*</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>example</realm-name>
</login-config>
<security-role>
<role-name>user</role-name>
</security-role>
<security-role>
<role-name>anonymous</role-name>
</security-role>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment