# Error Codes

During implementation, you may encounter various errors with Myinfo API. This can be caused by various reasons such as implementation issues, wrong input or environmental differences.&#x20;

All Myinfo APIs will return a standard HTTP error code together with an error message. The error code/message may change from time to time but it can be used for debugging.&#x20;

Troubleshooting and debugging of the APIs can be done in the following steps.&#x20;

1. Identification of which API is not working and an error is being returned from Myinfo Servers (e.g /authorize, /token, /person) Errors cound also occur due to
   * Connectivity errors (ensure there is no firewall blocking)
   * Incorrect urls and path parameters
2. Once an error is returned from Myinfo API, note down the error message and status code and utilise below table to debug
3. If issue persists or unable to resolve the issue, please submit a request at [partnersupport.singpass.gov.sg ](https://partnersupport.singpass.gov.sg/)

***

## Authorize API

|            |               |                                                                                                                                                                                                                   |                                                                                                                                                                |
| ---------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Error Code | Error Message | Reason                                                                                                                                                                                                            | Remediation                                                                                                                                                    |
| 302        |               | <p>Possible to have the following error codes in the 'error' attribute.</p><ul><li>invalid\_scope : Invalid scope was requested in authorize URL</li><li>access\_denied: When user did not give consent</li></ul> |                                                                                                                                                                |
| 400        |               | Invalid parameters sent in authorize URL                                                                                                                                                                          | Verify querystring parameters are correct as per specifications(<https://public.cloud.myinfo.gov.sg/myinfo/api/myinfo-kyc-v4.0.0.html#operation/getauthorize>) |
| 404        |               | Invalid client\_id sent in authorize URL                                                                                                                                                                          | Verify if client\_id used has been set to live in DPP and correct client\_id was passed in url                                                                 |
| 440        |               | You are not logged in, or your previous session has expired.                                                                                                                                                      | Verify session is still valid, expiry of 2mins and also verify that browser is passing session cookie during redirect                                          |
| 500        |               | Unexpected error.                                                                                                                                                                                                 |                                                                                                                                                                |

***

## Token API

|                                                                                                                                                                                                                                                                                                                                                                                |                                                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |                                                                                                                                |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Error Code                                                                                                                                                                                                                                                                                                                                                                     | Error Message                                     | Reason                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Remediation                                                                                                                    |
| 400                                                                                                                                                                                                                                                                                                                                                                            | No body found for POST request                    | Body was not sent in request                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | Verify body was sent in request                                                                                                |
| <ul><li>Invalid client\_assertion</li><li>Missing jti in client\_assertion</li><li>Missing sub in client\_assertion</li><li>Invalid sub in client\_assertion</li><li>Missing aud in client\_assertion</li><li>Missing iat in client\_assertion</li><li>Missing exp in client\_assertion</li><li>Invalid exp in client\_assertion</li><li>Duplicate client\_assertion</li></ul> | Format of client\_assertion is incorrect          | <p>Verify client\_assertion format are correct as per specifications(<a href="https://public.cloud.myinfo.gov.sg/myinfo/api/myinfo-kyc-v4.0.0.html#section/Security/Client-Assertion"><https://public.cloud.myinfo.gov.sg/myinfo/api/myinfo-kyc-v4.0.0.html#section/Security/Client-Assertion></a>)<br><br>Utilize client\_assertion <a href="https://api.singpass.gov.sg/library/myinfo/developers/client-assertion-verifier">Generator/Verifier</a><br><br>Ensure client\_assertion is signature is correct (Need to be signed with private key corresponding to sign key configured in JWKS) <br><br>Ensure client\_assertion is used only once per transactiont</p> |                                                                                                                                |
| Invalid client\_assertion\_type                                                                                                                                                                                                                                                                                                                                                | Invalid client\_assertion\_type value passed in   | Verify value is "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                                                                                                                |
| Error Retrieving JWKS                                                                                                                                                                                                                                                                                                                                                          | Error retrieving JWKS from Myinfo Servers         | Ensure correct JWKS endpoint is configured onto DPP and is a public URL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |                                                                                                                                |
| <ul><li>Invalid JWKS</li><li>Missing valid sig key in JWKS</li><li>Missing valid enc key in JWKS</li></ul>                                                                                                                                                                                                                                                                     | JWKS format is incorrect                          | <p>Ensure JWKS is returned as a JSON object with this format (<a href="https://public.cloud.myinfo.gov.sg/myinfo/api/myinfo-kyc-v4.0.0.html#section/Security/Enhancements-in-v4"><https://public.cloud.myinfo.gov.sg/myinfo/api/myinfo-kyc-v4.0.0.html#section/Security/Enhancements-in-v4></a>) <br><br>Ensure JWKS has at least 1 sign key with alg = 'ES256' and use = 'sig<br><br>Ensure JWKS has at least 1 encryption key with alg = 'ECDH-ES +A256KW' and use = 'enc'<br><br>Utilize <a href="https://api.singpass.gov.sg/library/myinfo/developers/jwks-verifier">JWKS verifier</a></p>                                                                         |                                                                                                                                |
| Missing DPoP Proof                                                                                                                                                                                                                                                                                                                                                             | DPoP Proof JWT is missing in headers              | Ensure DPoP Proof JWT is passed in correctly in HTTP headers                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |                                                                                                                                |
| Missing  {param} from headers                                                                                                                                                                                                                                                                                                                                                  | Missing mandatory param in the HTTP header        | Verify specified mandatory param is passed in the HTTP header as per specifications (<https://public.cloud.myinfo.gov.sg/myinfo/api/myinfo-kyc-v4.0.0.html#operation/gettoken>)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |                                                                                                                                |
| Missing  {param} from body                                                                                                                                                                                                                                                                                                                                                     | Missing mandatory param in the HTTP body          | Verify specified mandatory param is passed in the HTTP header as per specifications (<https://public.cloud.myinfo.gov.sg/myinfo/api/myinfo-kyc-v4.0.0.html#operation/gettoken>)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |                                                                                                                                |
| 401                                                                                                                                                                                                                                                                                                                                                                            | Unauthorized.                                     | App does not have access to this API                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Ensure App is configured correctly and is live on DPP                                                                          |
| <ul><li>Invalid DPoP Proof</li><li>Missing jkt in DPoP Proof</li><li>Invalid jkt in DPoP Proof</li><li>Missing htm in DPoP Proof</li><li>Invalid htm in DPoP Proof</li><li>Missing htu in DPoP Proof</li><li>Invalid htu in DPoP Proof</li></ul>                                                                                                                               | Invalid DPoP Proof JWT format                     | <p>Verify DPoP Token format is correct as per specifications(<a href="https://public.cloud.myinfo.gov.sg/myinfo/api/myinfo-kyc-v4.0.0.html#section/Security/Demonstration-of-Proof-of-Possesion-(DPoP)"><https://public.cloud.myinfo.gov.sg/myinfo/api/myinfo-kyc-v4.0.0.html#section/Security/Demonstration-of-Proof-of-Possesion-(DPoP)></a><br><br>Utilize <a href="https://api.singpass.gov.sg/library/myinfo/developers/dpop-verifier">DPoP verifier</a><br><br>Ensure DPoP is signature is correct (Need to be signed with private key corresponding to public key embedded in JWT header) </p>                                                                   |                                                                                                                                |
| Invalid JWS Verification                                                                                                                                                                                                                                                                                                                                                       | Signature of DPoP or client\_assertion is invalid | <ul><li>Verify private key used to sign client\_assertion matches the sig key in JWKS</li><li>Verify kid in client\_assertion header matches the corresponding kid in JWKS</li><li>Verify JWK in DPoP Proof header is the correct public key to verify the private key</li></ul><p><br><br>Utilize <a href="https://api.singpass.gov.sg/library/myinfo/developers/dpop-verifier">DPoP verifier</a><br><br>Ensure DPoP is signature is correct (Need to be signed with private key corresponding to public key embedded in JWT header) </p>                                                                                                                              |                                                                                                                                |
| 404                                                                                                                                                                                                                                                                                                                                                                            | Not found.                                        | Invalid client\_id passed to API                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Verify App is configured correctly on DPP and correct client\_id(ensure correct id is used in the correct environment) is used |
| 500                                                                                                                                                                                                                                                                                                                                                                            | Internal server error.                            | Unexpected error.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |                                                                                                                                |

***

## Person API

|                                                                        |                                                                                                                                                                                                                                                                                                                      |                                                                                                                                                                                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Error Code                                                             | Error Message                                                                                                                                                                                                                                                                                                        | Reason                                                                                                                                                                                | Remediation                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| 400                                                                    | Invalid Encyption key                                                                                                                                                                                                                                                                                                | Encryption key is of an Invalid format                                                                                                                                                | Ensure JWKS has at least 1 encryption key with alg = 'ECDH-ES +A256KW' and use = 'enc'                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Missing DPoP Proof                                                     | DPoP Proof JWT is missing in headers                                                                                                                                                                                                                                                                                 | Ensure DPoP Token is passed in correctly in HTTP headers                                                                                                                              |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Duplicated DPoP-bound access\_token                                    | access\_token has already been used                                                                                                                                                                                                                                                                                  | access\_token is a one time use, ensure a new access\_token is retrieved for every API call                                                                                           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Missing {param} from query parameters                                  | Missing mandatory param in the query parameters                                                                                                                                                                                                                                                                      | Verify specified mandatory param is passed in the query parameters as per specifications (<https://public.cloud.myinfo.gov.sg/myinfo/api/myinfo-kyc-v4.0.0.html#operation/getperson>) |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Missing {param} from headers                                           | Missing mandatory param in the HTTP headers                                                                                                                                                                                                                                                                          | Verify specified mandatory param is passed in the query parameters as per specifications (<https://public.cloud.myinfo.gov.sg/myinfo/api/myinfo-kyc-v4.0.0.html#operation/getperson>) |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| 401                                                                    | <ul><li>Invalid DPoP Proof</li><li>Missing ath in DPoP Proof</li><li>Invalid ath in DPoP Proof</li><li>Missing jkt in DPoP Proof</li><li>Invalid jkt in DPoP Proof</li><li>Missing htm in DPoP Proof</li><li>Invalid htm in DPoP Proof</li><li>Missing htu in DPoP Proof</li><li>Invalid htu in DPoP Proof</li></ul> | Invalid DPoP Proof JWT format                                                                                                                                                         | <p>Verify DPoP Token format is correct as per specifications(<a href="https://public.cloud.myinfo.gov.sg/myinfo/api/myinfo-kyc-v4.0.0.html#section/Security/Demonstration-of-Proof-of-Possesion-(DPoP)"><https://public.cloud.myinfo.gov.sg/myinfo/api/myinfo-kyc-v4.0.0.html#section/Security/Demonstration-of-Proof-of-Possesion-(DPoP)></a><br><br>Utilize <a href="https://api.singpass.gov.sg/library/myinfo/developers/dpop-verifier">DPoP verifier</a><br><br>Ensure DPoP is signature is correct (Need to be signed with private key corresponding to public key embedded in JWT header) <br><br>Ensure DPoP is signed with the same private key used to create DPoP in /token call.</p> |
| 403                                                                    | DPoP-bound access\_token aud doesn't match with requested url                                                                                                                                                                                                                                                        | access\_token aud does not match resource being called                                                                                                                                | Verify correct access\_token matching service being called is used                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| DPoP-bound access\_token realm doesn't match with requested realm      | access\_token realm does not match resource being called                                                                                                                                                                                                                                                             | Verify correct access\_token matching service being called is used                                                                                                                    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| DPoP-bound access\_token subject doesn't match with requested sub      | access\_token sub does not match uuid being requested in API                                                                                                                                                                                                                                                         | Verify the same uuid is requested as provided in access\_token                                                                                                                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| DPoP-bound access\_token scope doesn't match with requested attributes | access\_token scope does not match scope being requested in API                                                                                                                                                                                                                                                      | Verify the same scope is requested as provided in access\_token                                                                                                                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| DPoP-bound access\_token invalid                                       | access\_token is of an invalid format                                                                                                                                                                                                                                                                                | Verify the access\_token passed in API request is correct and from /token response                                                                                                    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| 404                                                                    |                                                                                                                                                                                                                                                                                                                      | Requested sub's data may not be available                                                                                                                                             | Verify the access\_token passed in API request is correct and from /token response                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| 500                                                                    | Internal server error.                                                                                                                                                                                                                                                                                               | Unexpected error.                                                                                                                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

<br>
