I have successfully set a custom password policy in WSO2 Identity Server 6 through the Carbon management console. However, in our scenario, we have a custom frontend integrated with WSO2 Identity Server, and we need to retrieve the password policy configuration from the server to inform users about the correct password pattern.
Is there an endpoint or API in WSO2 Identity Server 6 that allows us to programmatically retrieve the password policy configuration? I want to fetch this information in our custom frontend to display meaningful messages to users regarding the correct password pattern.
Any guidance or examples on how to achieve this would be greatly appreciated. Thank you!
Additional Information:
You can use the following REST API to retrieve the password policy information. From that API response, you can get min length, max length, regex pattern of the allowed password, and what is the error message to be shown on password policy violation.
curl --location 'https://<host>:<port>/api/server/v1/identity-governance/UGFzc3dvcmQgUG9saWNpZXM/connectors/cGFzc3dvcmRQb2xpY3k' \
--header 'Authorization: Basic YWRtaW46YWRtaW4='
API documentation: https://is.docs.wso2.com/en/6.0.0/apis/identity-governance-rest-api/#/
In the above curl
UGFzc3dvcmQgUG9saWNpZXM
-> This is the governance category id of Password Policies
cGFzc3dvcmRQb2xpY3k
-> This is the connector id of passwordPolicy
(NOTE: Recommend to use bearer token for the API authorization the authorization)
Regarding display meaningful messages to users regarding the correct password pattern
: To achieve this you have to configure passwordPolicy.errorMsg
properly according to the configured regex and min max length.
Otherwise, showing the regex pattern mismatch error to the end user doesn't meet the best user experience.