7 Troubleshooting
If you experience problems when attempting to use the MyID Core API:
-
Check that you have set up the server-to-server authentication correctly.
-
For PKCE-based end-user authentication, check that you have set up PKCE correctly.
See section 4.2.1, Generating a PKCE code verifier and code challenge, and see the PKCE standard for details of requirements for the code verifier and code challenge:
Make sure you are using Base64 URL encoding to create the code challenge, and not simply Base64 encoding.
-
Review the documentation to ensure that you are using the API calls correctly.
-
Check that you have configured access to the API for the features you want to use.
-
If you cannot see the people, requests, devices and so on that you expect, check that the operator account used to access the API has the correct scope.
See section 2.2.1, Scope.
-
If you have clients in the appsettings.json file and the appsettings.Production.json file, make sure the production file does not overwrite the entries in the base file. In these settings files, entries in arrays are determined by their index; therefore if you have four existing entries in the appsettings.json file, you must include four blank array entries {}, in the appsettings.Production.json file before you include your new client details. Alternatively, you can include the entire Clients array in the appsettings.Production.json file.
-
Application setting JSON files are sensitive to such issues as comma placement; if the format of the file is not correct, the web service cannot load the file and will not operate, which may result in an error similar to:
HTTP Error 500.30 - ANCM In-Process Start Failure
Note especially that copying code samples from a browser may include hard spaces, which cause the JSON file to be invalid.
To assist in tracking down the problem, you can use the Windows Event Viewer. Check the Windows Logs > Application section for errors; you may find an error from the .NET Runtime source that contains information similar to:
Exception Info: System.FormatException: Could not parse the JSON file.
---> System.Text.Json.JsonReaderException: '"' is invalid after a value. Expected either ',', '}', or ']'. LineNumber: 13 | BytePositionInLine: 6.
which could be caused by a missing comma at the end of a line.
An error similar to:
Exception Info: System.FormatException: Could not parse the JSON file.
---> System.Text.Json.JsonReaderException: '0xC2' is an invalid start of a property name. Expected a '"'. LineNumber: 7 | BytePositionInLine: 0.
is caused by a hard (non-breaking) space copied from a web browser, which is not supported in JSON.
Note: Some JSON files used by MyID contain comment lines beginning with double slashes // – these comments are not supported by the JSON format, so the JSON files will fail validation if you attempt to use external JSON validation tools. However, these comments are supported in the JSON implementation provided by asp.net.core, and so are valid in the context of MyID.
-
If you see an error message, look up the error code.
See the Error Code Reference guide for a list of errors codes, their causes, and potential solutions.
-
Enable logging on the rest.core and web.oauth2 web services.
See the MyID REST and authentication web services section in the Configuring Logging guide.