Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/pom.xml
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/pom.xml	(revision 4244)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/pom.xml	(revision 4245)
@@ -247,5 +247,5 @@
             <version>8.4-702.jdbc4</version>
         </dependency>
-        <dependency>
+       <!-- <dependency>
             <groupId>org.springframework.security</groupId>
             <artifactId>spring-security-core</artifactId>
@@ -260,6 +260,6 @@
             <groupId>org.springframework.security</groupId>
             <artifactId>spring-security-web</artifactId>
-            <version>${spring.version}</version>
-        </dependency>
+            <version>${spring.version}</version> 
+        </dependency> -->
         <dependency>
             <groupId>cglib</groupId>
@@ -271,4 +271,15 @@
             <artifactId>slf4j-log4j12</artifactId>
             <version>${slf4j.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>de.mpg.mpgaai</groupId>
+            <artifactId>mpgaai-shhaa</artifactId>
+            <version>1.0.3</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>commons-logging</groupId>
+                    <artifactId>commons-logging</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
     </dependencies>
@@ -281,5 +292,5 @@
         <netbeans.hint.license>gpl20</netbeans.hint.license>  
         <plugin.license.copyrightYear>2013</plugin.license.copyrightYear>
-        <project.version>1.0</project.version>
+        <project.version>1.1</project.version>
     </properties>
 </project>
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AnnotationResource.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AnnotationResource.java	(revision 4244)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AnnotationResource.java	(revision 4245)
@@ -55,5 +55,4 @@
 import javax.xml.bind.JAXBElement;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.annotation.Secured;
 import org.springframework.stereotype.Component;
 import org.slf4j.Logger;
@@ -105,5 +104,4 @@
     @Produces(MediaType.TEXT_XML)
     @Path("{annotationid: " + BackendConstants.regExpIdentifier + "}")
-    @Secured("ROLE_USER")
     @Transactional(readOnly = true)
     public JAXBElement<Annotation> getAnnotation(@PathParam("annotationid") String ExternalIdentifier) throws IOException {
@@ -135,5 +133,4 @@
     @Produces(MediaType.TEXT_XML)
     @Path("{annotationid: " + BackendConstants.regExpIdentifier + "}/targets")
-    @Secured("ROLE_USER")
     @Transactional(readOnly = true)
     public JAXBElement<ReferenceList> getAnnotationTargets(@PathParam("annotationid") String ExternalIdentifier) throws IOException {
@@ -160,5 +157,4 @@
     @Produces(MediaType.TEXT_XML)
     @Path("")
-    @Secured("ROLE_USER")
     @Transactional(readOnly = true)
     public JAXBElement<AnnotationInfoList> getFilteredAnnotations(@QueryParam("link") String link,
@@ -183,5 +179,4 @@
     @Produces(MediaType.TEXT_XML)
     @Path("{annotationid: " + BackendConstants.regExpIdentifier + "}/permissions")
-    @Secured("ROLE_USER")
     @Transactional(readOnly = true)
     public JAXBElement<UserWithPermissionList> getAnnotationPermissions(@PathParam("annotationid") String ExternalIdentifier) throws IOException {
@@ -208,5 +203,4 @@
     @DELETE
     @Path("{annotationid: " + BackendConstants.regExpIdentifier + "}")
-    @Secured("ROLE_USER")
     public String deleteAnnotation(@PathParam("annotationid") String externalIdentifier) throws IOException {
         dbIntegrityService.setServiceURI(uriInfo.getBaseUri().toString());
@@ -234,5 +228,4 @@
     @Produces(MediaType.APPLICATION_XML)
     @Path("")
-    @Secured("ROLE_USER")
     public JAXBElement<ResponseBody> createAnnotation(Annotation annotation) throws IOException {
         dbIntegrityService.setServiceURI(uriInfo.getBaseUri().toString());
@@ -249,5 +242,4 @@
     @Produces(MediaType.APPLICATION_XML)
     @Path("{annotationid: " + BackendConstants.regExpIdentifier + "}")
-    @Secured("ROLE_USER")
     public JAXBElement<ResponseBody> updateAnnotation(@PathParam("annotationid") String externalIdentifier, Annotation annotation) throws IOException {
         String path = uriInfo.getBaseUri().toString();
@@ -281,5 +273,4 @@
     @Produces(MediaType.APPLICATION_XML)
     @Path("{annotationid: " + BackendConstants.regExpIdentifier + "}/body")
-    @Secured("ROLE_USER")
     public JAXBElement<ResponseBody> updateAnnotationBody(@PathParam("annotationid") String externalIdentifier, AnnotationBody annotationBody) throws IOException {
         String path = uriInfo.getBaseUri().toString();
@@ -307,5 +298,4 @@
     @Produces(MediaType.APPLICATION_XML)
     @Path("{annotationid: " + BackendConstants.regExpIdentifier + "}/permissions/{userid: " + BackendConstants.regExpIdentifier + "}")
-    @Secured("ROLE_USER")
     public String updatePermission(@PathParam("annotationid") String annotationExternalId, @PathParam("userid") String userExternalId, Permission permission) throws IOException {
         dbIntegrityService.setServiceURI(uriInfo.getBaseUri().toString());
@@ -335,5 +325,4 @@
     @Produces(MediaType.APPLICATION_XML)
     @Path("{annotationid: " + BackendConstants.regExpIdentifier + "}/permissions/")
-    @Secured("ROLE_USER")
     public JAXBElement<ResponseBody> updatePermissions(@PathParam("annotationid") String annotationExternalId, UserWithPermissionList permissions) throws IOException {
         dbIntegrityService.setServiceURI(uriInfo.getBaseUri().toString());
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/CachedRepresentationResource.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/CachedRepresentationResource.java	(revision 4244)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/CachedRepresentationResource.java	(revision 4245)
@@ -40,5 +40,4 @@
 import javax.xml.parsers.ParserConfigurationException;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.annotation.Secured;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
@@ -71,5 +70,4 @@
     @Produces(MediaType.TEXT_XML)
     @Path("{cachedid: " + BackendConstants.regExpIdentifier + "}/metadata")
-    @Secured("ROLE_USER")
     @Transactional(readOnly = true)
     public JAXBElement<CachedRepresentationInfo> getCachedRepresentationInfo(@PathParam("cachedid") String externalId) throws SQLException, IOException {
@@ -88,5 +86,4 @@
     @Produces({"image/jpeg", "image/png"})
     @Path("{cachedid: " + BackendConstants.regExpIdentifier + "}/content")
-    @Secured("ROLE_USER")
     @Transactional(readOnly = true)
     public BufferedImage getCachedRepresentationContent(@PathParam("cachedid") String externalId) throws SQLException, IOException {
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/TargetResource.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/TargetResource.java	(revision 4244)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/TargetResource.java	(revision 4245)
@@ -45,5 +45,4 @@
 import javax.xml.parsers.ParserConfigurationException;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.annotation.Secured;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
@@ -82,5 +81,4 @@
     @Produces(MediaType.TEXT_XML)
     @Path("{targetid: " + BackendConstants.regExpIdentifier + "}")
-    @Secured("ROLE_USER")
     @Transactional(readOnly = true)
     public JAXBElement<Target> getTarget(@PathParam("targetid") String ExternalIdentifier) throws SQLException, IOException {
@@ -100,5 +98,4 @@
     @Produces(MediaType.TEXT_XML)
     @Path("{targetid: " + BackendConstants.regExpIdentifier + "}/versions")
-    @Secured("ROLE_USER")
     @Transactional(readOnly = true)
     public JAXBElement<ReferenceList> getSiblingTargets(@PathParam("targetid") String ExternalIdentifier) throws SQLException, IOException {
@@ -133,5 +130,4 @@
     @Produces(MediaType.APPLICATION_XML)
     @Path("{targetid: " + BackendConstants.regExpIdentifier + "}/fragment/{fragmentDescriptor}/cached")
-    @Secured("ROLE_USER")
     public JAXBElement<CachedRepresentationInfo> postCached(@PathParam("targetid") String targetIdentifier,
             @PathParam("fragmentDescriptor") String fragmentDescriptor,
@@ -151,5 +147,4 @@
     @DELETE
     @Path("{targetid: " + BackendConstants.regExpIdentifier + "}/cached/{cachedid: " + BackendConstants.regExpIdentifier + "}")
-    @Secured("ROLE_ADMIN")
     public String deleteCachedForTarget(@PathParam("targetid") String targetExternalIdentifier,
             @PathParam("cachedid") String cachedExternalIdentifier) throws SQLException, IOException {
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/UserResource.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/UserResource.java	(revision 4244)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/UserResource.java	(revision 4245)
@@ -42,5 +42,4 @@
 import javax.xml.parsers.ParserConfigurationException;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.annotation.Secured;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
@@ -74,5 +73,4 @@
     @Produces(MediaType.TEXT_XML)
     @Path("{userid: " + BackendConstants.regExpIdentifier + "}")
-    @Secured("ROLE_USER")
     @Transactional(readOnly = true)
     public JAXBElement<User> getUser(@PathParam("userid") String ExternalIdentifier) throws SQLException, IOException {
@@ -91,5 +89,4 @@
     @Produces(MediaType.TEXT_XML)
     @Path("/info")
-    @Secured("ROLE_USER")
     @Transactional(readOnly = true)
     public JAXBElement<User> getUserByInfo(@QueryParam("email") String email) throws SQLException, IOException {
@@ -107,5 +104,4 @@
     @Produces(MediaType.TEXT_XML)
     @Path("{userid: " + BackendConstants.regExpIdentifier + "}/current")
-    @Secured("ROLE_USER")
     @Transactional(readOnly = true)
     public JAXBElement<CurrentUserInfo> getCurrentUserInfo(@PathParam("userid") String ExternalIdentifier) throws IOException {
@@ -127,5 +123,4 @@
     @Produces(MediaType.TEXT_XML)
     @Path("{remoteId: " + BackendConstants.regExpIdentifier + "}")
-    @Secured("ROLE_ADMIN")
     public JAXBElement<User> addUser(@PathParam("userid") String remoteId, User user) throws SQLException {
         dbIntegrityService.setServiceURI(uriInfo.getBaseUri().toString());
@@ -139,5 +134,4 @@
     @Produces(MediaType.TEXT_XML)
     @Path("")
-    @Secured("ROLE_ADMIN")
     public JAXBElement<User> updateUser(User user) throws IOException{
         dbIntegrityService.setServiceURI(uriInfo.getBaseUri().toString());
Index: SISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/resources/spring-config/applicationContext-security.xml
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/resources/spring-config/applicationContext-security.xml	(revision 4244)
+++ 	(revision )
@@ -1,45 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    Copyright (C) 2013 DASISH
-
-    This program is free software; you can redistribute it and/or
-    modify it under the terms of the GNU General Public License
-    as published by the Free Software Foundation; either version 2
-    of the License, or (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
--->
-<beans:beans xmlns="http://www.springframework.org/schema/security"
-  xmlns:beans="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-           http://www.springframework.org/schema/security
-           http://www.springframework.org/schema/security/spring-security-3.2.xsd">    
-
-
-
- 
-<global-method-security secured-annotations="enabled"/>
- 
-<http auto-config="true" use-expressions="true" access-denied-page="/index.jsp">
- <logout invalidate-session="true" logout-success-url="/index.jsp"/>   
-</http>
-
-<authentication-manager>
-    <authentication-provider>
-        <password-encoder ref="bCryptPasswordEncoder"/>
-        <jdbc-user-service data-source-ref="dataSource"/>
-    </authentication-provider>
-</authentication-manager>
-
-</beans:beans>
Index: SISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/resources/spring-config/bCryptPasswordEncoder.xml
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/resources/spring-config/bCryptPasswordEncoder.xml	(revision 4244)
+++ 	(revision )
@@ -1,29 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    Copyright (C) 2013 DASISH
-
-    This program is free software; you can redistribute it and/or
-    modify it under the terms of the GNU General Public License
-    as published by the Free Software Foundation; either version 2
-    of the License, or (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
--->
-<beans 
-  xmlns="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">    
-
-<bean id='bCryptPasswordEncoder' class='org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder'/>
-
-</beans>
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/shhaa.xml
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/shhaa.xml	(revision 4245)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/shhaa.xml	(revision 4245)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright (C) 2013 DASISH
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+-->
+<ROOT>
+    <shhaa>
+
+	<authentication>
+	    <shibheader>
+		<username>oid:eduPersonPrincipalName</username>
+		<username>mace:eduPersonPrincipalName</username>
+		<username>eduPersonPrincipalName</username>
+		
+		<username>oid:eduPersonTargetedID</username>
+		<username>mace:eduPersonTargetedID</username>
+		<username>eduPersonTargetedID</username>
+
+		<session>Shib-Session-ID</session>
+		<idp>Shib-Identity-Provider</idp>
+		<timestamp>Shib-Authentication-Instant</timestamp>
+	    </shibheader>
+	    <fallback>
+		<username>anonymous</username>
+	    </fallback>
+	    <sso action="lI">https://lux16.mpi.nl/Shibboleth.sso/Login</sso> 
+	    <slo action="lO">https://lux16.mpi.nl/Shibboleth.sso/Logout</slo> 
+            <!-- <sso action="lI">http://localhost:8080/annotator-backend/api/index.jsp</sso> 
+	    <slo action="lO">http://localhost:8080/annotator-backend/api/index.jsp</slo>  -->
+	</authentication>
+	
+	
+	<!-- <composition action="rF">
+	    <shibheader>
+		<attribute>displayName</attribute>
+		<attribute>commonName</attribute>
+	    </shibheader>
+	</composition> -->
+
+	
+	<authorization>
+	    <location  target="/hvwkejfhvwkehf/*" />
+	</authorization>
+	
+	
+	
+    </shhaa>
+</ROOT>
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web.xml
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web.xml	(revision 4244)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web.xml	(revision 4245)
@@ -66,10 +66,11 @@
         <url-pattern>/webresources/*</url-pattern>
     </servlet-mapping>
-    <filter>
-        <filter-name>springSecurityFilterChain</filter-name>
-        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
+    
+     <filter>
+        <filter-name>AAIFilter</filter-name>
+        <filter-class>de.mpg.aai.shhaa.AuthFilter</filter-class>
     </filter>
     <filter-mapping>
-        <filter-name>springSecurityFilterChain</filter-name>
+        <filter-name>AAIFilter</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/index.jsp
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/index.jsp	(revision 4244)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/index.jsp	(revision 4245)
@@ -40,8 +40,8 @@
         DELETE <form action="api/notebooks/_nid_" method="DELETE"><input type="submit" /></form>api/notebooks/_nid_	Delete _nid_. Annotations stay, they just lose connection to _nid_.<br> 
  -->
-     <br> 
+    <!--  <br> 
      <a href="spring_security_login"> Login</a> <br> 
      <br> 
-     <a href="j_spring_security_logout"> Logout</a> <br> 
+     <a href="j_spring_security_logout"> Logout</a> <br> -->
      <br> 
       <b>Test URI-s</b><br>
Index: SISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/BCryptTestUserPasswordEncoder.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/BCryptTestUserPasswordEncoder.java	(revision 4244)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/*
- * Copyright (C) 2013 DASISH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-package eu.dasish.annotation.backend.rest;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-/**
- *
- * @author olhsha
- */
-@RunWith(value = SpringJUnit4ClassRunner.class)
-@ContextConfiguration({"/spring-test-config/dataSource.xml"})
-public class BCryptTestUserPasswordEncoder {
-    
-    final   Map<String, String> userPassword= new HashMap<String, String>();
-    private Map<String, String> passwordHash= new HashMap<String, String>();
-    private BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
-    
-    
-    public BCryptTestUserPasswordEncoder(){
-        userPassword.put("olha", "olha"+"password");
-        userPassword.put("stephanie", "stephanie"+"password");
-        userPassword.put("olof", "olof"+"password");
-        userPassword.put("twan", "twan"+"password");
-        userPassword.put("peter", "peter"+"password");
-        userPassword.put("przemek", "przemek"+"password");
-        userPassword.put("daan", "daan"+"password");
-        userPassword.put("menzo", "menzo"+"password");
-        userPassword.put("eric", "eric"+"password");
-    }
-    
-    
-    @Test
-    public void generateHashes(){
-        System.out.println("Passwords -- hashes:");
-        for (String user:userPassword.keySet()){
-            String hash = passwordEncoder.encode(userPassword.get(user));
-            System.out.println(userPassword.get(user)+" -- "+hash);
-            passwordHash.put(userPassword.get(user), hash);
-        }
-    }
-}
