# Medplum OAuth Demo
This is a demonstration of how to use Medplum with an External Auth Provider or "Federated Identities".
This repo is similar to [medplum-client-oauth-demo](https://github.com/medplum/medplum-client-oauth-demo), except that is uses an external identity provider.

## Setup
Setup your external authentication provider (Auth0, AWS Cognito, Okta, etc). Use "https://api.medplum.com/auth/external" as the "redirect URI". Note the following details:
- Authorize URL
- Token URL
- UserInfo URL
- Client ID
- Client secret
Setup your Medplum account:
- [Register for a Medplum account](https://www.medplum.com/docs/tutorials/register)
- Create a `ClientApplication`
- Set the "Redirect URI" to "http://localhost:8000/"
- Add an external identity provider with the details from above
Update the values in `src/main.ts` accordingly.
Now you can run this demo:
```bash
npm run dev
```
Open your web browser to <http://localhost:8000/>