@@ -525,6 +525,31 @@ public Request<Void> resetPassword(String email, String connection) {
525525 * @return a Request to execute.
526526 */
527527 public Request <Void > resetPassword (String clientId , String email , String connection ) {
528+ return resetPassword (clientId , email , connection , null );
529+ }
530+
531+ /**
532+ * Request a password reset for the given client ID, email, database connection and organization ID. The response will always be successful even if
533+ * there's no user associated to the given email for that database connection.
534+ * i.e.:
535+ * <pre>
536+ * {@code
537+ * try {
538+ * authAPI.resetPassword("CLIENT-ID", "me@auth0.com", "db-connection", "ORGANIZATION-ID").execute().getBody();
539+ * } catch (Auth0Exception e) {
540+ * //Something happened
541+ * }
542+ * }
543+ * </pre>
544+ *
545+ * @see <a href="https://auth0.com/docs/api/authentication#change-password">Change Password API docs</a>
546+ * @param clientId the client ID of your client.
547+ * @param email the email associated to the database user.
548+ * @param connection the database connection where the user was created.
549+ * @param organization the organization ID where the user was created.
550+ * @return a Request to execute.
551+ */
552+ public Request <Void > resetPassword (String clientId , String email , String connection , String organization ) {
528553 Asserts .assertNotNull (email , "email" );
529554 Asserts .assertNotNull (connection , "connection" );
530555
@@ -538,6 +563,7 @@ public Request<Void> resetPassword(String clientId, String email, String connect
538563 request .addParameter (KEY_CLIENT_ID , clientId );
539564 request .addParameter (KEY_EMAIL , email );
540565 request .addParameter (KEY_CONNECTION , connection );
566+ request .addParameter (KEY_ORGANIZATION , organization );
541567 return request ;
542568 }
543569
0 commit comments