Restrict patient and provider access to specific p...
# support
a
Hi Medplum team. Bumping this question from earlier: https://discord.com/channels/905144809105260605/1318247500439883857/1318247500439883857 I have a project with both a provider portal and a patient portal. I would like to restrict access so that patients can only log in to the patient portal, and vice versa. It seems like
AccessPolicy
resources are great for restricting by IP, but in this case, I need to enforce restrictions based on the domain (e.g., blocking patients from accessing the provider portal’s domain). What is the best way to set this up? Thank you!
r
Hi @alex_empallo , thansk for your patience on this, and sorry for missing your last post
Right now, we don't have a way tor restrict the login type base on access policies.
However, in the
MedplumClient
, you can specify the type of "profile" (
Patient
,
Practitioner
,
RelatedPerson
) that is logging in. Our auth methods all take the
BaseLoginRequest
object as a param. The
resourceType
param there specifies what profileType is used https://github.com/medplum/medplum/blob/38fe93bd9e5d2957d3b494454e050f6cca5c7e3d/packages/core/src/client.ts#L385 You can see an example of how this is used in our AuthenticationForm React component https://github.com/medplum/medplum/blob/f9dc331bef9099ae9d62b43034d81f6285a5b608/packages/react/src/auth/AuthenticationForm.tsx
a
Awesome, this works great 🙂 Thanks so much Rahul!!
186 Views