smart-doctor v0.2.0 GitHub

Error catalogue

Every cause, in the order a login runs

57 causes smart-doctor can report: what each means and how to fix it. Search for the error code or the exact message your server sent.

By error code

The standard OAuth codes, and what usually sits behind each.

CodeWhat it meansUsual causes
invalid_clientThe server could not authenticate your client. It is deliberately vague: the same answer covers a wrong client ID, key, secret or assertion.Your kid is not in the JWKS the server knows aboutaud does not exactly match the token endpointSigning key does not match the published public keyClient secret rejectedWrong client_id for this environmentClock skew between you and the serverThe server cannot fetch your JWKSServer-side registration does not match (what we cannot see)
invalid_grantThe grant itself was rejected: in sign-in, usually the authorization code (used, expired, or redirect_uri/PKCE mismatch); in backend services, often the assertion.Authorization code already usedAuthorization code expiredredirect_uri differs between sign-in and token exchangePKCE verification failedRefresh token rejectedAssertion expired, too long-lived, or not yet valid
invalid_requestA parameter is missing, repeated or malformed. Read error_description: it usually names the parameter.Authorization request rejectedaud rejected at sign-inRedirect URI rejected at sign-inServer wants the client secret sent another wayServer does not advertise PKCE S256
invalid_scopeOne or more requested scopes are unknown, malformed or not allowed for this client.Requested scopes not allowedScopes rejected at sign-inScope syntax version may not match the server
unauthorized_clientThe client is known but not allowed to use this grant or flow here (disabled, not activated, wrong client type).Client exists but is not enabled/authorisedApp not allowed to sign in this wayclient_credentials grant not allowed
access_deniedThe user or the organisation declined, or this user may not use the app.Access denied at sign-in
unsupported_grant_typeThe token endpoint does not accept this grant type for this client.client_credentials grant not allowed

Reaching the server

7 causes

Before any login: the network, the FHIR base URL and the token endpoint.

Client secrets

6 causes

Confidential clients that authenticate with a client secret.

Keys and JWKS

9 causes

Your signing key, the public JWKS the server reads, and how the two match.

The signed client assertion

6 causes

The private_key_jwt the server checks on every token request.

Client registration

4 causes

What the server knows about your client, which you cannot see from outside.

Scopes

3 causes

What you ask for versus what the registration allows.

Sign-in at the EHR

13 causes

The authorization request, the redirect back, and its state.

Code exchange

4 causes

Turning the authorization code into tokens.

Tokens, context and access

5 causes

What came back: patient context, id_token, refresh token, and the first FHIR call.