core.medplumclient.startjwtbearerlogin | Medplum

MedplumClient.startJwtBearerLogin() method

Starts a new OAuth2 JWT bearer flow.

Signature:

startJwtBearerLogin(clientId: string, assertion: string, scope: string): Promise<ProfileResource>;

Parameters

Parameter Type Description
clientId string The client ID.
assertion string The JWT assertion.
scope string The OAuth scope.

Returns:

Promise< ProfileResource >

Promise that resolves to the client profile.

Example

await medplum.startJwtBearerLogin(import.meta.env.MEDPLUM_CLIENT_ID, import.meta.env.MEDPLUM_JWT_BEARER_ASSERTION, 'openid profile');

// Example Search

await medplum.searchResources('Patient')

See RFC 7523 Section 2.1 for full details.