Skip to content

Commit 2475bf1

Browse files
committed
Added organization support for Change Password
1 parent 903ea0a commit 2475bf1

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/main/java/com/auth0/client/auth/AuthAPI.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)