Approve an enrollment
Every device beyond a tenant’s founding one enrolls by asking an existing Admin or Owner to approve it. The new device shows a code. The approver’s device computes the same code on its own. The approver confirms the two codes match and confirms the person’s identity. Only then does the approver’s device sign the approval. An Admin cannot review their own device. A pending request for an Admin’s own device never appears as one they can approve.
client.people, the People namespace, carries the whole flow:
enrollmentRequests()returns anEnrollmentRequestSummaryfor each open request.reviewEnrollment(requestId)returns anEnrollmentReviewfor one of them.
The calls
The samples use the allowed helper from Access decisions.
const requests = await client.people.enrollmentRequests();// [{ requestId, person, replaces, requestedAt, lapsesAt }, ...]
const review = await client.people.reviewEnrollment(requests[0].requestId);const code = await review.waitForCode();showCode(code);
if (confirmedCaller && codeMatches) { await allowed(await review.approve());} else { await allowed(await review.reject());}let requests = try await client.people.enrollmentRequests()let review = try await client.people.reviewEnrollment(requests[0].requestId)let code = try await review.waitForCode()showCode(code)
if confirmedCaller && codeMatches { _ = try await allowed(review.approve())} else { _ = try await allowed(review.reject())}val requests = client.people.enrollmentRequests()val review = client.people.reviewEnrollment(requests[0].requestId)val code = review.waitForCode()showCode(code)
if (confirmedCaller && codeMatches) { allowed(review.approve())} else { allowed(review.reject())}client.on('enrollment-request', ({ requestId }) => ...) fires when another device asks to enroll. The approver’s screen updates without polling. The request also appears as an enrollment-request item in the worklist.
What the SDK does for you
- Computes the code only after the requesting device reveals its secret.
- Computes
EnrollmentReview.codelocally, never from the Seald Healthcare Cloud. A compromised Seald Healthcare Cloud cannot hand out a matching code. - Excludes an Admin’s own pending device from what
enrollmentRequests()returns for that Admin. - Requires a fresh multi-factor sign-in and signs the exact request before
approve()returns a decision.
Decisions and errors you may see
Outcome or ErrorCode | When | What to do |
|---|---|---|
deny on approve() | The caller was not confirmed, or approving would fail a tenant policy. | Reject the request instead. |
challenge on approve() | The caller’s multi-factor sign-in is no longer fresh. | Call stepUp(), or use the allowed helper. |
enrollment-lapsed (on the enrolling device’s wait()) | The request was not approved before it expired. | The person enrolls again. |