Skip to content

Commit

Permalink
Merge pull request #621 from RushanNanayakkara/sms_otp_pw_recovery
Browse files Browse the repository at this point in the history
Validate Password Recovery Connector Configuration Updates
  • Loading branch information
RushanNanayakkara authored Jun 26, 2024
2 parents 768888c + 46f2d60 commit 7eec8e0
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

import org.apache.commons.lang.StringUtils;
import org.slf4j.MDC;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.identity.recovery.ChallengeQuestionManager;

import java.nio.charset.StandardCharsets;
import java.util.Base64;
Expand All @@ -37,17 +35,6 @@ public class Util {
private static final String PAGINATION_LINK_FORMAT = Constants.V1_API_PATH_COMPONENT
+ "%s?offset=%d&limit=%d";

/**
* Get ChallengeQuestionManager osgi service
*
* @return ChallengeQuestionManager
*/
@Deprecated
public static ChallengeQuestionManager getChallengeQuestionManager() {
return (ChallengeQuestionManager) PrivilegedCarbonContext.getThreadLocalCarbonContext()
.getOSGiService(ChallengeQuestionManager.class, null);
}

/**
* Get correlation id of current thread
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ public enum ErrorMessage {
ERROR_CODE_INCORRECT_CONNECTOR_NAME("50011", "Invalid connector name",
"Unable to find a connector with the name %s."),
ERROR_CODE_UNSUPPORTED_PROPERTY_NAME("50012", "Unsupported property is requested.",
"The property %s is not supported by this API.");
"The property %s is not supported by this API."),
ERROR_CODE_INVALID_CONNECTOR_CONFIGURATION("50013", "Connector update failed.",
"Unable to update the identity governance connector. %s");

private final String code;
private final String message;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, WSO2 LLC. (http://www.wso2.com).
* Copyright (c) 2019-2024, WSO2 LLC. (http://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
Expand Down Expand Up @@ -42,6 +42,7 @@
import org.wso2.carbon.identity.governance.IdentityGovernanceException;
import org.wso2.carbon.identity.governance.IdentityGovernanceService;
import org.wso2.carbon.identity.governance.bean.ConnectorConfig;
import org.wso2.carbon.identity.governance.exceptions.general.IdentityGovernanceClientException;

import java.net.URI;
import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -297,7 +298,9 @@ public void updateGovernanceConnectorProperty(String categoryId, String connecto
configurationDetails.put(propertyReqDTO.getName(), propertyReqDTO.getValue());
}
identityGovernanceService.updateConfiguration(tenantDomain, configurationDetails);

} catch (IdentityGovernanceClientException e) {
throw handleBadRequestError(GovernanceConstants.ErrorMessage.ERROR_CODE_INVALID_CONNECTOR_CONFIGURATION,
e.getMessage());
} catch (IdentityGovernanceException e) {
GovernanceConstants.ErrorMessage errorEnum =
GovernanceConstants.ErrorMessage.ERROR_CODE_ERROR_UPDATING_CONNECTOR_PROPERTY;
Expand Down Expand Up @@ -508,4 +511,5 @@ private APIError handleNotFoundError(String resourceId,

return new APIError(status, errorResponse);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ paths:
<td>Disable, if the client application handles notification sending</td>
</tr>
<tr>
<td rowspan="20">account-recovery</td>
<td rowspan="22">account-recovery</td>
<td>Recovery.Notification.Password.Enable</td>
<td>Notification based password recovery</td>
</tr>
Expand Down Expand Up @@ -483,6 +483,14 @@ paths:
<td>Recovery.AutoLogin.Enable</td>
<td>User will be logged in automatically after completing the Password Reset wizard</td>
</tr>
<tr>
<td>Recovery.Notification.Password.emailLink.Enable</td>
<td>Notification based password recovery via an email</td>
</tr>
<tr>
<td>Recovery.Notification.Password.smsOtp.Enable</td>
<td>Notification based password recovery using SMS OTP</td>
</tr>
<tr>
<td rowspan="3">admin-forced-password-reset</td>
<td>Recovery.AdminPasswordReset.RecoveryLink</td>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@
<version.org.wso2.orbit.javax.xml.bind>2.3.1.wso2v1</version.org.wso2.orbit.javax.xml.bind>
<maven.buildnumber.plugin.version>1.4</maven.buildnumber.plugin.version>
<org.apache.felix.annotations.version>1.2.4</org.apache.felix.annotations.version>
<identity.governance.version>1.8.62</identity.governance.version>
<identity.governance.version>1.9.17</identity.governance.version>
<carbon.identity.framework.version>7.2.37</carbon.identity.framework.version>
<maven.findbugsplugin.version>3.0.5</maven.findbugsplugin.version>
<findsecbugs-plugin.version>1.12.0</findsecbugs-plugin.version>
Expand Down

0 comments on commit 7eec8e0

Please sign in to comment.