Committed by
Gerrit Code Review
Providing sample web.xml configuration for enabling basic authentication of REST API & GUI.
Change-Id: I1ee8853945611d7778a4a4dc38883cfe266a5efa
Showing
2 changed files
with
50 additions
and
0 deletions
| ... | @@ -20,6 +20,31 @@ | ... | @@ -20,6 +20,31 @@ |
| 20 | id="ONOS" version="2.5"> | 20 | id="ONOS" version="2.5"> |
| 21 | <display-name>ONOS REST API v1.0</display-name> | 21 | <display-name>ONOS REST API v1.0</display-name> |
| 22 | 22 | ||
| 23 | + <!-- | ||
| 24 | + <security-constraint> | ||
| 25 | + <display-name>authenticated</display-name> | ||
| 26 | + <web-resource-collection> | ||
| 27 | + <web-resource-name>All files</web-resource-name> | ||
| 28 | + <description/> | ||
| 29 | + <url-pattern>/*</url-pattern> | ||
| 30 | + </web-resource-collection> | ||
| 31 | + <auth-constraint> | ||
| 32 | + <description/> | ||
| 33 | + <role-name>admin</role-name> | ||
| 34 | + </auth-constraint> | ||
| 35 | + </security-constraint> | ||
| 36 | + | ||
| 37 | + <login-config> | ||
| 38 | + <auth-method>BASIC</auth-method> | ||
| 39 | + <realm-name>karaf</realm-name> | ||
| 40 | + </login-config> | ||
| 41 | + | ||
| 42 | + <security-role> | ||
| 43 | + <description/> | ||
| 44 | + <role-name>admin</role-name> | ||
| 45 | + </security-role> | ||
| 46 | + --> | ||
| 47 | + | ||
| 23 | <servlet> | 48 | <servlet> |
| 24 | <servlet-name>JAX-RS Service</servlet-name> | 49 | <servlet-name>JAX-RS Service</servlet-name> |
| 25 | <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class> | 50 | <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class> | ... | ... |
| ... | @@ -25,6 +25,31 @@ | ... | @@ -25,6 +25,31 @@ |
| 25 | </welcome-file-list> | 25 | </welcome-file-list> |
| 26 | 26 | ||
| 27 | <!-- | 27 | <!-- |
| 28 | + <security-constraint> | ||
| 29 | + <display-name>authenticated</display-name> | ||
| 30 | + <web-resource-collection> | ||
| 31 | + <web-resource-name>All files</web-resource-name> | ||
| 32 | + <description/> | ||
| 33 | + <url-pattern>/*</url-pattern> | ||
| 34 | + </web-resource-collection> | ||
| 35 | + <auth-constraint> | ||
| 36 | + <description/> | ||
| 37 | + <role-name>admin</role-name> | ||
| 38 | + </auth-constraint> | ||
| 39 | + </security-constraint> | ||
| 40 | + | ||
| 41 | + <login-config> | ||
| 42 | + <auth-method>BASIC</auth-method> | ||
| 43 | + <realm-name>karaf</realm-name> | ||
| 44 | + </login-config> | ||
| 45 | + | ||
| 46 | + <security-role> | ||
| 47 | + <description/> | ||
| 48 | + <role-name>admin</role-name> | ||
| 49 | + </security-role> | ||
| 50 | + --> | ||
| 51 | + | ||
| 52 | + <!-- | ||
| 28 | <servlet> | 53 | <servlet> |
| 29 | <servlet-name>Index Page</servlet-name> | 54 | <servlet-name>Index Page</servlet-name> |
| 30 | <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class> | 55 | <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class> | ... | ... |
-
Please register or login to post a comment