Hi!
I think there might be a conceptual misunderstanding here -
Personal Access Tokens (PATs) and OAuth2 aren't meant to work together. In fact, for most use cases you should be using one of Medplum's OAuth2 flows rather than PATs.
Could you help us understand what you're trying to accomplish?
For user-facing applications (web or mobile apps where users log in):
→ Use the [OAuth2 Authorization Code Flow](
https://www.medplum.com/docs/auth/methods/oauth-auth-code)
For server-to-server communication (backend services, scripts, automation):
→ Use the [Client Credentials Flow](
https://www.medplum.com/docs/auth/methods/client-credentials)
For device/host authentication (lab analyzers, on-premise machines):
→ See the [Device Authentication](
https://www.medplum.com/docs/auth/methods) section
Our [Authentication Patterns Overview](
https://www.medplum.com/docs/auth/methods) has a helpful diagram showing which method to use for different scenarios.
Let us know more about your specific use case and we can point you to the right authentication flow!
---
Good catch - Client Credentials is definitely the right pattern for programmatic/server access.