Juan Hernandez has uploaded a new change for review.

Change subject: restapi: Different realms for different URLs
......................................................................

restapi: Different realms for different URLs

Currently we deploy the RESTAPI application twice, once for the /api URL
and another time for the /ovirt-engine/api URL. But both deployments use
the same basic authentication realm. As a result when a browser
authenticates with one URL it will be automatically authenticated with
the other one, as the browser will remember the credentials and send
them automatically if the realm is the same. To avoid thi issue this
patch changes the names of the realms, so that they will be different.

Change-Id: I36140bf236b7043f3b813863ce8db635012a11ce
Related: https://bugzilla.redhat.com/1077441
Signed-off-by: Juan Hernandez <juan.hernan...@redhat.com>
---
M Makefile
M backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/web.xml
2 files changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/22/30222/1

diff --git a/Makefile b/Makefile
index 2442232..55b7b9b 100644
--- a/Makefile
+++ b/Makefile
@@ -366,6 +366,9 @@
        sed -i \
                
's|<context-root>/ovirt-engine/api</context-root>|<context-root>/api</context-root>|'
 \
                "$(DESTDIR)$(DATA_DIR)/legacy_restapi.war/WEB-INF/jboss-web.xml"
+       sed -i \
+               's|<param-value>Basic 
realm="RESTAPI"</param-value>|<param-value>Basic realm="ENGINE"</param-value>|' 
\
+               "$(DESTDIR)$(DATA_DIR)/legacy_restapi.war/WEB-INF/web.xml"
        install -dm 0755 "$(DESTDIR)$(PKG_HTML_DIR)"
        find "$(MAVEN_OUTPUT_DIR)" -name '*-javadoc.jar' -type f | grep -v 
tmp.repos | while read f; do \
                comp="$$(basename "$${f}" | sed 's/-[0-9].*//')"; \
diff --git 
a/backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/web.xml 
b/backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/web.xml
index aadab51..8801a4d 100644
--- a/backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/web.xml
+++ b/backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/web.xml
@@ -96,7 +96,7 @@
 Add an init-param per each scheme -->
     <init-param>
       <param-name>scheme.basic_auth</param-name>
-      <param-value>Basic realm="ENGINE"</param-value>
+      <param-value>Basic realm="RESTAPI"</param-value>
     </init-param>
   </filter>
   <filter-mapping>


-- 
To view, visit http://gerrit.ovirt.org/30222
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I36140bf236b7043f3b813863ce8db635012a11ce
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernan...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to