Skip to content

Aimprosoft/user-account-switcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

User Switcher plugin. Includes both: repo and share development in SDK 3

Description

Additional page on administration tools page. Allows user with admin permissions login under another account registered in alfresco without knowing his/her password. Admin sees table with all user logins. He can select user login and click on Switch User action button. After this action, admin will be redirected to user home page. Security context will be replaced with chosen user.

Installation

  1. Build 2 jars using maven build files under repo-login-switcher and share-login-switcher:
  • open terminal in ./repo-login-switcher and run the command
mvn clean package
  • open terminal in ./share-login-switcher and run the command
mvn clean package
  1. Copy files from target folders:
  • Copy repo-login-switcher-1.5.jar into {alfresco_installation_folder}/tomcat/webapps/alfresco/WEB-INF/lib
  • Copy share-login-switcher-1.5.jar into {alfresco_installation_folder}/tomcat/webapps/share/WEB-INF/lib

Start alfresco

How to use plugin in SDK 4

In order to use the User Switcher plugin in SDK 4 you need to place the plugin's jar files in Tomcat directory into the docker image. JAR extensions are copied directly into the exploded webapp. To do this, follow these steps.

  1. Clone source files.
  2. Open terminal in user-switcher package and run the command:
mvn package
  1. Create in package your-alfresco-SDK4/your-alfresco-platform-docker/ package jars.
  2. Create in package your-alfresco-SDK4/your-alfresco-share-docker/ package jars.
  3. Copy repo-login-switcher-1.5.jar from user-switcher/repo-login-switcher/target/ to your-alfresco-SDK4/your-alfresco-platform-docker/jars.
  4. Copy share-login-switcher-1.5.jar from user-switcher/share-login-switcher/target/ to your-alfresco-SDK4/your-alfresco-share-docker/jars.
  5. Open in editor your-alfresco-SDK4/your-alfresco-platform-docker/pom.xml and add new execution :
<execution>
  <id>copy-jar</id>
  <phase>package</phase>
  <goals>
     <goal>copy-resources</goal>
  </goals>
  <configuration>
    <outputDirectory>${project.build.directory}/extensions</outputDirectory>
       <resources>
          <resource>
             <filtering>false</filtering>
               <directory>jars</directory>
          </resource>
       </resources>
   </configuration>
 </execution>

in:

<build>
 <plugins>
   <plugin>
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-dependency-plugin</artifactId>
      <version>3.0.2</version>
      <executions>
      ...
      <executions>
   </plugin>
 </plugins>
</build>
  1. Do the same for your-alfresco-SDK4/your-alfresco-share-docker/pom.xml.
  2. And now in your-alfresco-SDK4/ open terminal and run the command:
./run.sh build_start

Work with plugin

  • Login in Alfresco with admin permissions and choose Admin Tools:

alt text

  • Select Login manager:

alt text

  • Users will be shown in the table:

alt text

  • Choose user and push Switch user:

alt text

  • You are login under another account:

alt text

How to use plugin with Alfresco Content Service Enterprise

  • Open the directory in which you downloaded docker-compose.yml file and create two packages repo and share.
  • Copy repo-login-switcher-1.5.jar to your-alfresco-enterprise/repo.
  • Copy share-login-switcher-1.5.jar to your-alfresco-enterprise/share.
  • Create Dockerfile in your-alfresco-enterprise/repo:
FROM alfresco/alfresco-content-repository:6.1.0

ARG TOMCAT_DIR=/usr/local/tomcat

COPY *.jar $TOMCAT_DIR/webapps/alfresco/WEB-INF/lib/

  • Create Dockerfile in your-alfresco-enterprise/share:
FROM alfresco/alfresco-share:6.1.0

ARG TOMCAT_DIR=/usr/local/tomcat

COPY *.jar $TOMCAT_DIR/webapps/share/WEB-INF/lib/

  • In docker-compose.yml replace:
 alfresco:
         image: alfresco/alfresco-content-repository:6.1.0

with:

 alfresco:
         build: ./repo

and

 share:
         image: alfresco/alfresco-share:6.1.0

with:

 share:
         build: ./share
  • Run Alfresco:
 docker-compose up

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.