core.medplumclient.startclientlogin
Home > @medplum/core > MedplumClient > startClientLogin
MedplumClient.startClientLogin() method
Starts a new OAuth2 client credentials flow.
Signature:
startClientLogin(clientId: string, clientSecret: string): Promise<ProfileResource>;
Parameters
Parameter | Type | Description |
---|---|---|
clientId | string | The client ID. |
clientSecret | string | The client secret. |
Returns:
Promise<ProfileResource>
Promise that resolves to the client profile.
Example
await medplum.startClientLogin(import.meta.env.MEDPLUM_CLIENT_ID, import.meta.env.MEDPLUM_CLIENT_SECRET)
// Example Search
await medplum.searchResources('Patient')
See: https://datatracker.ietf.org/doc/html/rfc6749\#section-4.4