Skip to content
This repository was archived by the owner on Dec 9, 2025. It is now read-only.

Commit a70458a

Browse files
author
sachin-maheshwari
authored
Merge pull request #29 from appirio-tech/dev
New Auth Flow - restricting SSO (Enterprise) user to reset password.
2 parents b173162 + 1d277e9 commit a70458a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/main/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM appiriodevops/ap-microservice-base:0.0.1
1+
FROM appiriodevops/ap-microservice-base:0.0.2
22

33
MAINTAINER devops@appirio.com
44

src/main/java/com/appirio/tech/core/service/identity/resource/UserResource.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,11 @@ public ApiResponse changePassword(
820820
throw new APIRuntimeException(SC_UNAUTHORIZED, "Credentials are incorrect.");
821821
}
822822

823+
// SSO users can't reset their password.
824+
List<UserProfile> ssoProfiles = userDao.getSSOProfiles(Utils.toLongValue(user.getId()));
825+
if(ssoProfiles!=null && ssoProfiles.size()>0)
826+
throw new APIRuntimeException(HttpURLConnection.HTTP_FORBIDDEN, MSG_TEMPLATE_NOT_ALLOWED_TO_RESET_PASSWORD);
827+
823828
String error = user.validatePassoword();
824829
if (error != null) {
825830
throw new APIRuntimeException(SC_BAD_REQUEST, error);

0 commit comments

Comments
 (0)