Fixing login issues on restconf web resource
Change-Id: I33677d1de5f8bd00b35dc7a7786ea190f1bed606
(cherry picked from commit 9d5066b5211d94628acfb00086d90ea31f38e438)
diff --git a/protocols/restconf/server/rpp/src/main/webapp/WEB-INF/web.xml b/protocols/restconf/server/rpp/src/main/webapp/WEB-INF/web.xml
index 604057b..16a07b5 100644
--- a/protocols/restconf/server/rpp/src/main/webapp/WEB-INF/web.xml
+++ b/protocols/restconf/server/rpp/src/main/webapp/WEB-INF/web.xml
@@ -20,6 +20,27 @@
id="ONOS" version="2.5">
<display-name>ONOS RESTCONF Protocol Proxy</display-name>
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>Secured</web-resource-name>
+ <url-pattern>/*</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>admin</role-name>
+ <role-name>viewer</role-name>
+ </auth-constraint>
+ </security-constraint>
+
+ <security-role>
+ <role-name>admin</role-name>
+ <role-name>viewer</role-name>
+ </security-role>
+
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ <realm-name>karaf</realm-name>
+ </login-config>
+
<servlet>
<servlet-name>RESTCONF Protocol Proxy</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>