Clarification on List Enrollments Behavior
Description
Hi there,
I noticed that Enrollments() returns []*UserEnrollment and includes the comment:
Enrollments retrieves all Guardian enrollments for a user.
However, according to the official documentation, this API is meant to retrieve the first multi-factor authentication enrollment that a specific user has confirmed.
This discrepancy was previously discussed in PR #110, which was ultimately closed. A related community post also highlights this limitation.
Is there a correct way to retrieve all enrollments for a user? I came across ListAuthenticationMethods(), which seems similar, but I’m not sure if it’s the recommended alternative...
Auth0 Go SDK version
latest
Hi @shakeelrao,
Apologies for the delay!
Just a quick clarification: The Enrollments() method returns only the first MFA enrollment for a user.
If you want to retrieve all authentication methods configured for a user (e.g., TOTP, WebAuthn, etc.), please use the ListAuthenticationMethods() method from the Management API.
If you're looking for the actual enrolled authenticators you can use the ListAuthenticators() method from the Authentication API.
Hi @shakeelrao,
I'm closing this issue for now. If you still have questions, feel free to reopen it or create a new one. Thank you!