This is a demonstration of how to use Medplum as an OAuth2 Authorization Server.
This repo is similar to medplum-oauth-demo, except that is uses @medplum/core and MedplumClient.
It demonstrates:
- How to call the /oauth2/authorize endpoint to initiate the authorization flow
- How to call the /oauth2/token endpoint to exchange a code for an access token
- How to call the /oauth2/userinfo endpoint to retrive the current user details
- How to call the Medplum FHIR API with the access token
Setup your account:
- Register for a Medplum account
- Create a
ClientApplication - Set the "Redirect URI" to "http://localhost:8000/"
Now you can run this demo:
npm run devOpen your web browser to http://localhost:8000/