<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
		 version="3.0">

	<module-name>servlet-authz-app</module-name>

	<security-constraint>
		<web-resource-collection>
			<web-resource-name>All Resources</web-resource-name>
			<url-pattern>/*</url-pattern>
		</web-resource-collection>
		<auth-constraint>
			<role-name>user</role-name>
		</auth-constraint>
	</security-constraint>

	<security-constraint>
		<web-resource-collection>
			<web-resource-name>All Resources</web-resource-name>
			<url-pattern>/*</url-pattern>
		</web-resource-collection>
		<auth-constraint>
			<role-name>admin</role-name>
		</auth-constraint>
	</security-constraint>

	<login-config>
		<auth-method>KEYCLOAK</auth-method>
		<realm-name>servlet-authz</realm-name>
	</login-config>

	<security-role>
		<role-name>admin</role-name>
	</security-role>

	<security-role>
		<role-name>user</role-name>
	</security-role>

	<error-page>
		<error-code>403</error-code>
		<location>/accessDenied.jsp</location>
	</error-page>

</web-app>
