# Medplum NextAuth Demo https://github.com/awamser/medplum/assets/1259236/105f1a5e-f3f0-47db-8a78-89e9171d7e50 This sample application demonstrates how to use [NextAuth](https://next-auth.js.org/) to with Medplum's authentication framework ## Running the Demo 1. Install the dependencies ```bash npm install ``` 2. [Create a Medplum ClientApplication](https://www.medplum.com/docs/auth/methods/oauth-auth-code#create-a-client-application) and set the `redirectUri` to `http://localhost:3000/api/auth/callback/medplum`. 3. Generate a NextAuth secret: ```bash openssl rand -base64 32 ``` 4. Create an .env file ``` NEXTAUTH_SECRET= MEDPLUM_CLIENT_ID= MEDPLUM_CLIENT_SECRET= ``` 5. Run ```bash npm run dev ``` https://github.com/awamser/medplum/assets/1259236/abfa8073-1b26-4dbf-8845-05b770c7d9df