<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd">
        
<web-app>
    <display-name>Archetype Created Web Application</display-name>

    <context-param>
        <param-name>oauth.provider.provider-class</param-name>
        <param-value>org.jboss.resteasy.examples.oauth.provider.OAuthDBProvider</param-value>
    </context-param>

    <context-param>
        <param-name>javax.ws.rs.Application</param-name>
        <param-value>
           org.jboss.resteasy.examples.oauth.OAuthApplication
        </param-value>
    </context-param>

    <context-param>
       <param-name>resteasy.servlet.mapping.prefix</param-name>
       <param-value>/rest</param-value>
    </context-param>
    
    <context-param>
        <param-name>resteasy.role.based.security</param-name>
        <param-value>true</param-value>
    </context-param>
    
    <listener>
        <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
    </listener>

	<servlet>
        <servlet-name>OAuth</servlet-name>
        <servlet-class>org.jboss.resteasy.auth.oauth.OAuthServlet</servlet-class>
    </servlet>

    <servlet>
        <servlet-name>Resteasy</servlet-name>
        <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>OAuth</servlet-name>
        <url-pattern>/oauth/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>Resteasy</servlet-name>
        <url-pattern>/rest/*</url-pattern>
    </servlet-mapping>

    <security-constraint>
      <web-resource-collection>
         <web-resource-name>OAuth</web-resource-name>
         <url-pattern>/oauth/authorization/*</url-pattern>
      </web-resource-collection>
       <auth-constraint>
         <role-name>JBossAdmin</role-name>
      </auth-constraint>
    </security-constraint>
    
    <security-constraint>
      <web-resource-collection>
         <web-resource-name>Server</web-resource-name>
         <url-pattern>/rest/server/*</url-pattern>
      </web-resource-collection>
       <auth-constraint>
         <role-name>JBossAdmin</role-name>
      </auth-constraint>
    </security-constraint>
        
    <login-config>
      <auth-method>BASIC+OAUTH</auth-method>
      <realm-name>TokenAuthorization</realm-name>
    </login-config>

    <security-role>
      <role-name>JBossAdmin</role-name>
    </security-role>
    
</web-app>
