How to get PAT for FHIR backend?
# support
a
Hi everyone! I'm trying to connect to the cloud project backend via https://api.medplum.com/fhir/R4 but cant figure out where to get the PAT (Personal Access Token) for OAuth2. Any hint is much appreciated.
n
https://www.medplum.com/docs/auth/client-credentials This might be what you're looking for?
a
Thanks, I've found that page already. The problem is that I can't get a PAT anywhere. Any idea?
n
ah gotcha, not sure Medplum offers that specifically as an auth mechanism. Is there a specific use-case in mind that requires it? I'm not an expert but I've implemented most of the supported auth flows
a
I would like access just the FHIR backend to be able to validate the resources in a different frontend.
Found it. It's a resource of type ClientApplication.
r
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.
59 Views