lazybaer
11/24/2025, 8:18 PM{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "invalid",
"details": {
"text": "Failed to verify code - check your identity provider configuration"
}
}
],
"extension": [
{
"url": "https://medplum.com/fhir/StructureDefinition/tracing",
"extension": [
{
"url": "requestId",
"valueId": "06149170-c63e-414c-81ac-3aba919be269"
},
{
"url": "traceId",
"valueId": "1-6924bbdb-54b107a33232693458766d13"
}
]
}
]
}
any ideas? I've configured everything as per the documentation but it seems like the medplum auth/external endpoint doesn't like the config somewhere. The url that my IdP sends to has a code and a state parameter on it and the state has URL encoded JSON with the projectId, clientId and redirectUri inside.lazybaer
11/24/2025, 8:32 PMfinnbergquist
11/24/2025, 8:38 PMhttps://api.medplum.com/auth/externallazybaer
11/24/2025, 8:40 PMlocalhost and it's configured with
const MEDPLUM_BASE_URL = 'https://api.medplum.com/';
const EXTERNAL_REDIRECT_URI = MEDPLUM_BASE_URL + 'auth/external';
so yes it should be hitting that URLlazybaer
11/24/2025, 8:41 PMfinnbergquist
11/24/2025, 8:42 PMMEDPLUM_BASE_URL will need to be your hosted API URLlazybaer
11/24/2025, 8:43 PMfinnbergquist
11/24/2025, 8:46 PMredirectUri set on the ClientApplication?lazybaer
11/24/2025, 8:49 PMfinnbergquist
11/24/2025, 8:51 PMhttp://localhost:8000/lazybaer
11/24/2025, 8:51 PMfinnbergquist
11/24/2025, 8:51 PM/signin?lazybaer
11/24/2025, 8:52 PMlazybaer
11/24/2025, 8:52 PMlazybaer
11/24/2025, 8:52 PM/signin ?finnbergquist
11/24/2025, 8:52 PMfinnbergquist
11/24/2025, 8:53 PMlazybaer
11/24/2025, 8:57 PM{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "invalid",
"details": {
"text": "Failed to verify code - check your identity provider configuration"
}
}
],
"extension": [
{
"url": "https://medplum.com/fhir/StructureDefinition/tracing",
"extension": [
{
"url": "requestId",
"valueId": "8bbd2448-58c0-4a24-8faa-a309c33c0735"
},
{
"url": "traceId",
"valueId": "1-6924c5bb-67d437a0333313dd305957ed"
}
]
}
]
}lazybaer
11/24/2025, 8:58 PMfinnbergquist
11/24/2025, 8:59 PMMEDPLUM_CLIENT_ID you set in the example app is the ClientApplication that you sent screenshot of from above?lazybaer
11/24/2025, 9:00 PMlazybaer
11/24/2025, 9:00 PMfinnbergquist
11/24/2025, 9:05 PM/**
* External OAuth2 "authorize" endpoint URL.
* For example, this would be an Auth0, AWS Cognito, or Okta URL.
* This value is specific to your external auth provider.
*/
const EXTERNAL_AUTHORIZE_URL = '';
/**
* External OAuth2 client ID.
* This value is specific to your external auth provider.
*/
const EXTERNAL_CLIENT_ID = '';lazybaer
11/24/2025, 9:27 PMEXTERNAL_CLIENT_IDfinnbergquist
11/24/2025, 9:32 PMClientApplication.identityProvider?finnbergquist
11/24/2025, 9:33 PMfinnbergquist
11/24/2025, 9:33 PMlazybaer
11/24/2025, 9:33 PMconst handleClick = useCallback(() => {
medplum
.signInWithExternalAuth(
EXTERNAL_AUTHORIZE_URL,
EXTERNAL_CLIENT_ID,
EXTERNAL_REDIRECT_URI,
{
projectId: MEDPLUM_PROJECT_ID,
clientId: MEDPLUM_CLIENT_ID,
redirectUri: WEB_APP_REDIRECT_URI,
},
false,
)
.catch(console.error);
}, [medplum]);finnbergquist
11/24/2025, 9:34 PM{
"resourceType": "ClientApplication",
"redirectUri": "http://localhost:3000/signin",
"identityProvider": {
"authorizeUrl": "https://YOUR_CLERK_DOMAIN/oauth/authorize",
"tokenUrl": "https://YOUR_CLERK_DOMAIN/oauth/token",
"clientId": "YOUR_CLERK_CLIENT_ID",
"clientSecret": "YOUR_CLERK_CLIENT_SECRET"
}
}lazybaer
11/24/2025, 9:41 PMClientApplication record those are all set, yesfinnbergquist
11/24/2025, 9:58 PMlazybaer
11/24/2025, 9:59 PMfinnbergquist
11/24/2025, 9:59 PMfinnbergquist
11/24/2025, 9:59 PMlazybaer
11/24/2025, 9:59 PMlazybaer
11/24/2025, 9:59 PMlazybaer
11/24/2025, 10:00 PMfinnbergquist
11/24/2025, 10:00 PMlazybaer
11/24/2025, 10:03 PMcode from the URL and try and make this call? https://github.com/medplum/medplum/blob/ec580462ffb705f4de5e6dc6d8748c181e56503e/packages/server/src/auth/external.ts#L189lazybaer
11/24/2025, 10:04 PMfinnbergquist
11/24/2025, 10:11 PMfinnbergquist
11/24/2025, 10:12 PMlazybaer
11/24/2025, 10:13 PMlazybaer
11/24/2025, 10:13 PMlazybaer
11/25/2025, 12:01 AMfinnbergquist
11/25/2025, 1:50 PMlazybaer
11/25/2025, 8:57 PMIan Plunkett
12/09/2025, 10:05 PMredirectUris - https://www.medplum.com/docs/api/fhir/medplum/clientapplicationlazybaer
12/10/2025, 12:49 AMlazybaer
12/10/2025, 1:43 AMredirectUris field. Do I need to set that programatically perhaps?rahul1
12/10/2025, 4:26 PMIan Plunkett
12/10/2025, 7:08 PMlazybaer
12/12/2025, 3:29 PM