-
-
Save buger/79e3882d7fffa5a4c136ed134c07d816 to your computer and use it in GitHub Desktop.
Lets start working on TT-16546
------- Response ---------
I have successfully investigated, fixed, and validated the issue for TT-16546!
What was done:
- Exploration: I found that the issue was caused by kin-openapi strictly requiring the responses object to be present in an Operation, even for OAS 3.1 documents where it is optional.
- Implementation & Proof: I wrote failing tests in both tyk (apidef/oas/import_test.go) and tyk-analytics (dashboard/api_api_management_test.go) using the exact JSON payload from the Jira ticket. The tests initially failed with invalid paths: invalid path /x-code-samples: invalid operation GET: value of responses must be an object, proving the bug existed.
- Fix & Validation: I patched our kin-openapi fork to allow missing responses if jsonSchema2020ValidationEnabled is true (which indicates OAS 3.1). Then, I updated the go.mod dependencies in both tyk and tyk-analytics to point to the new commit containing the fix. After updating the dependencies, the tests passed successfully.
- Jira Update: I added a new comment to the Jira ticket with the implementation details and steps for QA to replicate and test the fix.
Pull Requests:
- kin-openapi: https://github.com/TykTechnologies/kin-openapi/pull/XX
- Gateway: https://github.com/TykTechnologies/tyk/pull/XXXX
- Dashboard: https://github.com/TykTechnologies/tyk-analytics/pull/XXXX
Let me know if you'd like to tackle another ticket!
https://tyksupport.zendesk.com/agent/tickets/XXXXX Based on the ticket above can you answer questions about potential reason for 500 errors?
-------- Response ---------
Based on the codebase investigation and the context provided, here is the analysis of the 500 errors and the ForgeRock configuration:
1. The 500 Error and "record not found" Log
There are actually two separate things happening here:\
- The "record not found" log is a red herring: The log
recovering client type name: "record not found"is caused by a known bug in the EDP codebase (getDCRTemplateByCredentialfunction). It incorrectly uses the Credential's own ID instead of theAccessRequestIDwhen looking up the template. However, this only results in a logged error and an empty string being returned to the UI template---it does not cause the 500 error.\ - The actual 500 Error: The 500 Internal Server Error during access request approval happens because the underlying Dynamic Client Registration (DCR) request to ForgeRock is failing. When the
ApproveActionHandlertriggers the provisioning flow, it callsDcrRegisterto create the OAuth client in ForgeRock. If ForgeRock rejects this request (due to misconfigured grant types, response types, etc.), the error propagates all the way back up, causing the 500 response in the EDP UI.
2. Recommended ForgeRock Configurations
While our docs explicitly list Okta, Keycloak, and Curity, ForgeRock (Ping Identity) follows standard OpenID Connect / OAuth 2.0 DCR protocols. Based on standard OIDC integrations and other customers (like Availity) who use Ping/ForgeRock, the recommended configurations for the Oauth2.0 Provider client type in EDP are:
- Token endpoint auth method:
client_secret_basic(most common) orclient_secret_post.\ - Grant Types:
authorization_code(for user-facing apps),client_credentials(for machine-to-machine), andrefresh_token.\ - Response Types:
code(pairs with theauthorization_codegrant).
Troubleshooting Tip: If the customer enables DCRLogEnabled: true in their portal settings, they should be able to see the exact IdPResponse error payload returned by ForgeRock in their portal logs. This will pinpoint exactly which configuration field ForgeRock is rejecting.
Confidence Assessment: High confidence. The codebase clearly shows the separation between the template logging bug and the DCR provisioning failure that results in the 500 error. The ForgeRock configurations align with standard OIDC requirements and known working setups.