Hi there, everyone! I hope you are all well. I've just created an app based on medplum that I'm wanting to release to iOS Mobile App Store -- but I am wondering if there are any examples of folks who have successfully integrated Apple Login for a Medplum App?
Based on reviewing the Medplum docs and our codebase, I understand the basic flow:
- External auth requires: authorize URL, token URL, userinfo URL, client ID/secret
- Redirect URI must be:
https://api.medplum.com/auth/external
- The provider must accept the profile OIDC scope
Current implementation pattern I found:
// Check auth method
const authMethod = await checkAuthMethod(email);
if (authMethod.isExternal) {
// Redirect to external provider
}
// For external auth flow
medplum.signInWithExternalAuth(
EXTERNAL_AUTHORIZE_URL,
EXTERNAL_CLIENT_ID,
EXTERNAL_REDIRECT_URI,
{
projectId: MEDPLUM_PROJECT_ID,
clientId: MEDPLUM_CLIENT_ID,
redirectUri: WEB_APP_REDIRECT_URI,
}
);
Specific questions for Apple Sign In:
1. Apple's OAuth endpoints - Has anyone configured these successfully?
- Authorize:
https://appleid.apple.com/auth/authorize
- Token:
https://appleid.apple.com/auth/token
- UserInfo: Apple doesn't provide a standard userinfo endpoint - how do you handle this?
2. Configuration challenges
- Apple requires JWT client authentication instead of client secret - how to configure this in Medplum?
3. FHIR mapping considerations
- Apple only provides email on first authentication
- How do you handle the "Hide My Email" feature with Patient resources?
Would really appreciate any code examples, configuration snippets, or lessons learned -- or even if this is just not possible yet! 🙏