Unable to Set User Password via REST API in OpenDJ #355
Replies: 3 comments 3 replies
-
Change Your PasswordNote
Perform an HTTPS POST with the header Content-Type: application/json, _action=modifyPassword in the query string, and the old and new passwords in JSON format as the POST data. The JSON POST DATA must include the following fields: oldPassword newPassword On success, the HTTP status code is 200 OK, and the response body is an empty JSON resource: $ curl \
--request POST \
--cacert ca-cert.pem \
--user bjensen:hifalutin \
--header "Content-Type: application/json" \
--data '{"oldPassword": "hifalutin", "newPassword": "chngthspwd"}' \
--silent \
https://localhost:8443/api/users/bjensen?_action=modifyPassword
{} Reset a PasswordWhenever one user changes another user’s password, DS servers consider it a password reset. Often, password policies specify that users must change their passwords again after a password reset. Note
Perform an HTTPS POST with the header Content-Type: application/json, _action=resetPassword in the query string, and an empty JSON document ({}) as the POST data. The following example demonstrates an administrator changing a user’s password. Before trying this example, make sure the password administrator has been given the password-reset privilege. Otherwise, the password administrator has insufficient access. On success, the HTTP status code is 200 OK, and the response body is a JSON resource with a generatedPassword containing the new password: $ curl \
--request POST \
--cacert ca-cert.pem \
--user kvaughan:bribery \
--header "Content-Type: application/json" \
--data '{}' \
--silent \
https://localhost:8443/api/users/bjensen?_action=resetPassword
{"generatedPassword":"<new-password>"} As password administrator, provide the new, generated password to the user. |
Beta Was this translation helpful? Give feedback.
-
Hello @vharseko , I was using the below link to setup opendj in HTTP mode Could you please help me with the steps to setup opendj in HTTPS mode? Regards, |
Beta Was this translation helpful? Give feedback.
-
Hi @vharseko , Thanks a lot for you reply. It worked. Now I am facing another issue in mapping the user to a group using REST API This is the curl command I am using to create a user in OpenDJ:
How can I specify the group name to which the user should be mapped during the user creation process using this curl command? A separate request to map the user to a group is also fine for me. Thanks in Advance |
Beta Was this translation helpful? Give feedback.
-
Context:
I have configured OpenDJ as an external data store for OpenAM and enabled the REST API. I am able to create users using the REST API successfully. For example, I created a user with the following command:
Problem:
The user is created successfully, but I am unable to log in with the newly created user from the OpenAM web login console because no password is set during the user creation process.
Configuration Details:
HTTP Authorization Mechanisms:
HTTP Endpoints:
Question:
Any guidance or examples would be greatly appreciated.
Thanks and Regards,
Anees
Beta Was this translation helpful? Give feedback.
All reactions