Skip to content

Commit 58363e5

Browse files
committed
Expose authenticators endpoint
1 parent d55ac58 commit 58363e5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

management/user.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,18 @@ type UserEnrollment struct {
193193
Type *string `json:"type,omitempty"`
194194
}
195195

196+
// UserAuthenticator contains information about an Authenticator
197+
type UserAuthenticator struct {
198+
// ID of this authenticator.
199+
ID *string `json:"id,omitempty"`
200+
// Type of authenticator
201+
Type *string `json:"type,omitempty"`
202+
// Status of the enrollment for this authenticator
203+
Confirmed *bool `json:"confirmed,omitempty"`
204+
// Start date and time of this enrollment.
205+
CreatedAt *time.Time `json:"created_at,omitempty"`
206+
}
207+
196208
// UserManager manages Auth0 User resources.
197209
type UserManager struct {
198210
*Management
@@ -385,3 +397,11 @@ func (m *UserManager) ListEnrollments(id string) (enrols []*UserEnrollment, err
385397
err = m.get(m.uri("users", id, "enrollments"), &enrols)
386398
return enrols, err
387399
}
400+
401+
// ListAuthenticators retrieves all authenticators for a user.
402+
//
403+
// It's an undocumented API ¯\_(ツ)_/¯
404+
func (m *UserManager) ListAuthenticators(id string) (enrols []*UserAuthenticator, err error) {
405+
err = m.get(m.uri("users", id, "authenticators"), &enrols)
406+
return enrols, err
407+
}

0 commit comments

Comments
 (0)