Changeset 4257


Ignore:
Timestamp:
01/13/14 15:32:38 (10 years ago)
Author:
olhsha
Message:

the e-mails now are saved in "lower-case" in the db and compared to the lower-cased e-mails. Two profiles are made: shibbolized and non-shibbolized

Location:
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/CHANGES.txt

    r4217 r4257  
    44deployment tar-ball which is from now on is generated using maven assembly
    55plug-in.
     6
     7January 9-10, 2014. The spring-security settings (authentication and authorisation)
     8are removed. Shibboleth sshaa.xml is added,  and web.xml is adapted. The boolean  column admin_rights
     9is added to the table "principal" in the DB. Adding, updating and deleting a user
     10in the DB (only by admin) is debugged and tested.
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/INSTALL.txt

    r4217 r4257  
    6868<server uri>/ds/webannotator
    6969
    70 Note that the path "ds/webannotator" is the same as mentioned in  ds#webannotator.xml above.
     70Note that the path "ds/webannotator" is the same as mentioned in  ds#webannotator.xml
     71above.
    7172
    7273On this web-page there is a number of test GET requests there which you can send if you want
    73 to check if it works. For this you will need a login and a password. Ask the dasish backend's
    74 responsible developer (Olha).
     74to check if it works. If you are not in the DB yet, any request will end up with the Server
     75error message "the logged-in-user". Ask Olha to add you providing with your shibboleth
     76remote ID. If you are in the DB you should be able to perform any request, except may be
     77getting annotation. If you have read access to the test annotation, you will get it.
     78
     79
    7580
    7681If you want to test POST, PUT and DELETE requests use e.g.
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/UPDATE.txt

    r4211 r4257  
    1 Take the tar-ball of the new  version XXX, and follow the standard MPI deployment procedure
    2 Consult the instructions from INSTALL.txt about placing war file.
     11. Placing tarball: as always, take the tar-ball of the new  version 1.1, and follow the
     2standard MPI deployment procedure.  Consult the instructions from INSTALL.txt
     3about placing war file if you haveforgotte.
    34
    4 For testing consult "Testing" section of INSTALL.txt.
     52. Adjusting shhaa.xml:  you need to set "sso action" and "slo action". E.g.
     6for lux16 they look as follows:
     7<sso action="lI">https://lux16.mpi.nl/Shibboleth.sso/Login</sso>
     8<slo action="lO">https://lux16.mpi.nl/Shibboleth.sso/Logout</slo>
     9For the other servers the sysadmins should know.
     10
     113. This time the dasish database on lux17 is changed because we removed spring-security
     12related tables. You have 2 options. Option A: remove the databse and copy the database from lux16
     13to lux17. Option B: remove the tables "users" and "authorities" from the databse, and add
     14a boolean column "admin_rights" to the table "principal", with the default values "false";
     15and set Olha's admin_rights to "true".
     16
     174. If the application is succesfully deployed, you will get the jsp page after requesting
     18
     19<server uri>/ds/webannotator
     20
     21On this web-page there is a number of test GET requests there which you can send if you want
     22to check if it works. If you are not in the DB yet, any request
     23will end up with the Server  error message "the logged-in-user". Ask Olha to add you
     24providing with your shibboleth  remote ID. If you are in the DB you should be able to perform any request, except may be
     25getting annotation. If you have read access to the test annotation,
     26you will get it. Ask Olha to test POST, PUT, DELETE or do it youself consulting "Testing"
     27section in INSTAL.txt.
    528
    629
     30
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/nb-configuration.xml

    r4209 r4257  
    1919    <spring-data xmlns="http://www.netbeans.org/ns/spring-data/1">
    2020        <config-files>
    21             <config-file>src/main/resources/spring-config/applicationContext-security.xml</config-file>
    22             <config-file>src/main/resources/spring-config/bCryptPasswordEncoder.xml</config-file>
     21            <config-file>src/main/webapp/WEB-INF/web-shaa.xml</config-file>
    2322        </config-files>
    2423        <config-file-groups/>
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/pom.xml

    r4245 r4257  
    247247            <version>8.4-702.jdbc4</version>
    248248        </dependency>
    249        <!-- <dependency>
     249        <!-- <dependency>
    250250            <groupId>org.springframework.security</groupId>
    251251            <artifactId>spring-security-core</artifactId>
     
    284284        </dependency>
    285285    </dependencies>
     286   
     287    <profiles>
     288        <profile>
     289            <id>lux16</id>
     290            <properties>
     291                <serviceRootUrl>http://lux16.mpi.nl/ds/webannotator/</serviceRootUrl>
     292                <!-- Will be inserted in context.xml -->
     293                <shibLI>http://lux16.mpi.nl/Shibboleth.sso/Login</shibLI>
     294                <!-- Shibboleth login URI for SHHAA -->
     295                <shibLO>http://lux16.mpi.nl/Shibboleth.sso/Logout</shibLO>
     296                <!-- Shibboleth logout URI for SHHAA -->
     297                <webXmlPath>src/main/webapp/WEB-INF/web-shib.xml</webXmlPath>
     298                <!-- web.xml for shibboleth authentication -->
     299            </properties>
     300        </profile>
     301       
     302        <profile>
     303            <id>lux17</id>
     304            <properties>
     305                <serviceRootUrl>http://lux17.mpi.nl/ds/webannotator/</serviceRootUrl>
     306                <!-- Will be inserted in context.xml -->
     307                <shibLI>http://lux17.mpi.nl/Shibboleth.sso/Login</shibLI>
     308                <!-- Shibboleth login URI for SHHAA -->
     309                <shibLO>http://lux17.mpi.nl/Shibboleth.sso/Logout</shibLO>
     310                <!-- Shibboleth logout URI for SHHAA -->
     311                <webXmlPath>src/main/webapp/WEB-INF/web-shib.xml</webXmlPath>
     312                <!-- web.xml for shibboleth authentication -->
     313            </properties>
     314        </profile>
     315       
     316        <profile>
     317            <id>localhost</id>
     318            <activation>
     319                <activeByDefault>true</activeByDefault>
     320            </activation>
     321            <properties>
     322                <serviceRootUrl>localhost:8080/annotator-backend/api/</serviceRootUrl>
     323                <webXmlPath>src/main/webapp/WEB-INF/web.xml</webXmlPath>
     324            </properties>
     325        </profile>
     326    </profiles>
     327       
    286328    <properties>
    287329        <jersey.version>1.17.1</jersey.version>
     
    294336        <project.version>1.1</project.version>
    295337    </properties>
     338   
     339   
    296340</project>
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcUserDao.java

    r4252 r4257  
    9797    @Override
    9898    public boolean userExists(User user){
    99         String emailCriterion = user.getEMail();
     99        String emailCriterion = user.getEMail().toLowerCase();
    100100        StringBuilder sqlTargets  = new StringBuilder("SELECT ");
    101101        sqlTargets.append(principal_id).append(" FROM ").append(principalTableName).append(" WHERE ").append(e_mail).append("= ? LIMIT 1");
     
    152152        params.put("externalId", newExternalIdentifier);
    153153        params.put("principalName", user.getDisplayName());
    154         params.put("email", user.getEMail());
     154        params.put("email", user.getEMail().toLowerCase());
    155155        params.put("remoteID", remoteID);
    156156        StringBuilder sql = new StringBuilder("INSERT INTO ");
     
    166166        StringBuilder sql = new StringBuilder("UPDATE ");
    167167        sql.append(principalTableName).append(" SET ").
    168                 append(e_mail).append("= '").append(user.getEMail()).append("',").
     168                append(e_mail).append("= '").append(user.getEMail().toLowerCase()).append("',").
    169169                append(principal_name).append("= '").append(user.getDisplayName()).append("' ").
    170170                append(" WHERE ").append(principal_id).append("= ?");
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/shhaa.xml

    r4252 r4257  
    2222    <shhaa>
    2323
    24         <authentication>
    25             <shibheader>
    26                 <username>oid:eduPersonPrincipalName</username>
    27                 <username>mace:eduPersonPrincipalName</username>
    28                 <username>eduPersonPrincipalName</username>
     24        <authentication>
     25            <shibheader>
     26                <username>oid:eduPersonPrincipalName</username>
     27                <username>mace:eduPersonPrincipalName</username>
     28                <username>eduPersonPrincipalName</username>
    2929               
    30                 <username>oid:eduPersonTargetedID</username>
    31                 <username>mace:eduPersonTargetedID</username>
    32                 <username>eduPersonTargetedID</username>
     30                <username>oid:eduPersonTargetedID</username>
     31                <username>mace:eduPersonTargetedID</username>
     32                <username>eduPersonTargetedID</username>
    3333
    34                 <session>Shib-Session-ID</session>
    35                 <idp>Shib-Identity-Provider</idp>
    36                 <timestamp>Shib-Authentication-Instant</timestamp>
    37             </shibheader>
    38             <fallback>
    39                 <username>anonymous</username>
    40             </fallback>
    41             <sso action="lI">https://lux16.mpi.nl/Shibboleth.sso/Login</sso>
    42             <slo action="lO">https://lux16.mpi.nl/Shibboleth.sso/Logout</slo>
    43         </authentication>
     34                <session>Shib-Session-ID</session>
     35                <idp>Shib-Identity-Provider</idp>
     36                <timestamp>Shib-Authentication-Instant</timestamp>
     37            </shibheader>
     38            <fallback>
     39                <username>anonymous</username>
     40            </fallback>
     41            <sso action="lI">${shibLI}</sso>
     42            <slo action="lO">${shibLO}</slo> 
     43        </authentication>
    4444       
    4545       
    46         <!-- <composition action="rF">
    47             <shibheader>
    48                 <attribute>displayName</attribute>
    49                 <attribute>commonName</attribute>
    50             </shibheader>
    51         </composition> -->
     46        <!-- <composition action="rF">
     47            <shibheader>
     48                        <attribute>displayName</attribute>
     49                        <attribute>commonName</attribute>
     50            </shibheader>
     51        </composition> -->
    5252
    5353       
    54         <authorization>
    55             <!-- lux16, 17, corpus1 -->
     54        <authorization>
    5655            <location  target="/*" />
    57             <!-- localhost -->
    58             <location  target="/dummy/*" />
    59         </authorization>
     56        </authorization>
    6057       
    6158       
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web.xml

    r4254 r4257  
    6565    </servlet-mapping>
    6666   
    67     <!-- lux16, 17, corpus 1 (shibbolized) -->
    68    <!--  <filter>
    69         <filter-name>AAIFilter</filter-name>
    70         <filter-class>de.mpg.aai.shhaa.AuthFilter</filter-class>
    71     </filter>
    72     <filter-mapping>
    73         <filter-name>AAIFilter</filter-name>
    74         <url-pattern>/*</url-pattern>
    75     </filter-mapping> -->
    76    
    77    
    78     <!-- localhost auth  -->
    79    
    8067    <security-constraint>
    8168        <display-name>Backend localhost</display-name>
     
    10188        <role-name>tomcat</role-name>
    10289    </security-role>
    103    
    10490</web-app>
Note: See TracChangeset for help on using the changeset viewer.