airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject airavata git commit: AIRAVATA-2342 remove UPDATE_PASSWORD required action when reset password
Date Wed, 24 May 2017 16:33:07 GMT
Repository: airavata
Updated Branches:
  refs/heads/develop ff0ccae99 -> df6cfd7d2


AIRAVATA-2342 remove UPDATE_PASSWORD required action when reset password

Keycloak automatically adds UPDATE_PASSWORD required action when
resetting the user's password with a temporary one. However, it doesn't
automatically remove the UPDATE_PASSWORD required action when resetting
the user's password with a non-temporary password, so this must be done
also in our code.


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/df6cfd7d
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/df6cfd7d
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/df6cfd7d

Branch: refs/heads/develop
Commit: df6cfd7d2f68d6b1d6416a9665b49426b2d51710
Parents: ff0ccae
Author: Marcus Christie <machristie@apache.org>
Authored: Wed May 24 12:29:14 2017 -0400
Committer: Marcus Christie <machristie@apache.org>
Committed: Wed May 24 12:29:14 2017 -0400

----------------------------------------------------------------------
 .../admin/services/core/impl/TenantManagementKeycloakImpl.java   | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/df6cfd7d/airavata-services/profile-service/iam-admin-services-core/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java
----------------------------------------------------------------------
diff --git a/airavata-services/profile-service/iam-admin-services-core/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java
b/airavata-services/profile-service/iam-admin-services-core/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java
index 60a8f5d..bc57f7d 100644
--- a/airavata-services/profile-service/iam-admin-services-core/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java
+++ b/airavata-services/profile-service/iam-admin-services-core/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java
@@ -335,6 +335,10 @@ public class TenantManagementKeycloakImpl implements TenantManagementInterface
{
                 credential.setValue(newPassword);
                 credential.setTemporary(false);
                 retrievedUser.resetPassword(credential);
+                // Remove the UPDATE_PASSWORD required action
+                UserRepresentation userRepresentation = retrievedUser.toRepresentation();
+                userRepresentation.getRequiredActions().remove("UPDATE_PASSWORD");
+                retrievedUser.update(userRepresentation);
                 return true;
             }else{
                 logger.error("requested User not found");


Mime
View raw message