auth0/auth0-java

Exposing a method in AuthAPI to delete MFA authenticators.

vasantteja opened this issue ยท 3 comments

Checklist

  • I have looked into the Readme and Examples, and have not found a suitable solution or answer.
  • I have looked into the API documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Describe the problem you'd like to have solved

We have the methods in AuthAPI to add and list oob and otp authenticators. It will be nice to have a method to delete those authenticators.

Describe the ideal solution

public Request<Void> deleteAuthenticator(String accessToken, String authenticatorId) {
    Asserts.assertNotNull(accessToken, "access token");
    Asserts.assertNotNull(authenticatorId, "authenticatorId");

    String url = baseUrl
        .newBuilder()
        .addPathSegment("mfa")
        .addPathSegment("authenticators")
        .build()
        .toString();

    VoidRequest request = new VoidRequest(client, null, url, HttpMethod.DELETE);
    request.addHeader("Authorization", "Bearer " + accessToken);
    request.addParameter(AUTHENTICATOR_ID, authenticatorId);
    return request;
}

Alternatives and current workarounds

No response

Additional context

No response

๐Ÿ‘‹ hey @vasantteja, thanks for the issue and the implementation snippet ๐Ÿ˜„. If you'd like to make a PR for this feature, I'm happy to review and help along the way (looks like you've pretty much got the implementation already ๐Ÿ˜‰)! If not, we should be able to get a PR for this out this week. Thanks!

@jimmyjames Sure let me take a stab at it. Thanks for the opportunity!!

Fixed with #541 - Thanks @vasantteja! I'll cut a new release either tomorrow or early next week; will see if there are other changes we want to include in a new minor ๐Ÿ‘