also the token is removed from the infra

This commit is contained in:
Massimiliano Assante 2020-01-17 17:07:32 +01:00
parent 9e3782d4c8
commit 67eeafea13
3 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,6 @@
# gCube System - User Registration Hook # gCube System - User Registration Hook
This component is a Liferay 6.2.6 CE Hook which intercepts new user accounts creation and removal and performs the related Workspace actions (on sHub and LDAP) This component is a Liferay 6.2.6 CE Hook which intercepts new user accounts creation and removal and performs the related Workspace actions (on sHub and LDAP and Auth)
* The source code is present in the src folder. * The source code is present in the src folder.

View File

@ -2,6 +2,4 @@ package org.gcube.portal.usersaccount;
public class Constants { public class Constants {
public static final String AUTORISED_INFRA_ROLE = "Infrastructure-Manager"; public static final String AUTORISED_INFRA_ROLE = "Infrastructure-Manager";
public static final String USERNAME_PREFERENCE_KEY = "admin.reserved.screen.names";
} }

View File

@ -1,6 +1,7 @@
package org.gcube.portal.usersaccount; package org.gcube.portal.usersaccount;
import org.gcube.portal.notifications.thread.NewUserAccountNotificationThread; import org.gcube.portal.notifications.thread.NewUserAccountNotificationThread;
import org.gcube.portal.removeaccount.thread.RemoveUserTokenFromInfraThread;
import org.gcube.portal.removeaccount.thread.RemovedUserAccountThread; import org.gcube.portal.removeaccount.thread.RemovedUserAccountThread;
import org.gcube.portal.removeaccount.thread.RemovedUserFromLDAPThread; import org.gcube.portal.removeaccount.thread.RemovedUserFromLDAPThread;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -44,6 +45,10 @@ public class MyCreateUserAccountListener extends BaseModelListener<User> {
_log.info("Trying to remove user from LDAP ..."); _log.info("Trying to remove user from LDAP ...");
Thread removeFromLDAPThread = new Thread(new RemovedUserFromLDAPThread(username2Delete)); Thread removeFromLDAPThread = new Thread(new RemovedUserFromLDAPThread(username2Delete));
removeFromLDAPThread.start(); removeFromLDAPThread.start();
_log.info("Trying to remove user from Auth ...");
Thread deleteAllUserAuthThread = new Thread(new RemoveUserTokenFromInfraThread(username2Delete));
deleteAllUserAuthThread.start();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }