[DX-2014] docs: add Keycloak worked example for issuing OAuth tokens via TIB - #2774
[DX-2014] docs: add Keycloak worked example for issuing OAuth tokens via TIB#2774sharadregoti wants to merge 8 commits into
Conversation
…ia TIB Adds a Keycloak (OpenID Connect) worked example to the "Issuing OAuth Tokens" section, alongside the existing GitHub and LDAP examples, so users implementing the Authorization Code Grant's identity-server role have a concrete, verified path using an external IdP. Also clarifies the APIListenPath and NoRedirect field descriptions based on issues found while verifying the flow end-to-end locally.
|
This PR adds a detailed worked example for using Keycloak as an OpenID Connect (OIDC) provider to issue Tyk OAuth 2.0 tokens via the Tyk Identity Broker (TIB). It addresses a documented customer need by providing a step-by-step guide for this common integration pattern. The PR also clarifies two important TIB configuration fields ( Files Changed Analysis
Architecture & Impact Assessment
sequenceDiagram |
Technical-accuracy Issues (3)
Technical-accuracy Issues (3)
Architecture Issues (3)
✅ Performance Check PassedNo performance issues found – changes LGTM. ✅ Quality Check PassedNo quality issues found – changes LGTM. Powered by Visor from Probelabs Last updated: 2026-08-27T05:57:52.557Z | Triggered by: pr_updated | Commit: 6e087bc 💡 TIP: You can chat with Visor using |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
User description
Summary
api-management/access-control/sessions-and-keys/issuing-tokens-via-tib.mdx, alongside the existing GitHub and LDAP examples, implementing theGenerateOAuthTokenForClientTIB action withSocialProvider/openid-connect.APIListenPath(must have no leading/trailing slash) andNoRedirect(should always be set explicitly).tyk-identity-broker/sso-keycloak.mdx's intro to also point at "Issuing Tokens via TIB", since its Keycloak client setup steps are now reused by the new worked example.Context
Jira: DX-2014 (Zendesk 22155). The customer's application currently handles SSO redirection itself before calling their API; they want to offload that redirect/token flow to Tyk, using Tyk's OAuth 2.0 Authorization Code Grant as documented at
api-management/authentication/oauth-2#using-the-authorization-code-grant. That page already explains the identity server role and links to TIB, butissuing-tokens-via-tib.mdxhad no worked example using an OIDC provider like Keycloak, only GitHub (Social) and LDAP.I confirmed the approach with OEL: Tyk Gateway cannot act as an OIDC Relying Party itself, so TIB acting as the identity server (as already documented) is the correct and only path. I verified the whole flow end-to-end locally (Keycloak → standalone TIB → Tyk Gateway OAuth2 authorization server → protected API), which surfaced two real gaps that are fixed by this PR:
APIListenPathmust be the bare API id/path segment with no leading or trailing slash; copying the listen path verbatim from the API definition produces a malformed URL and the Gateway returns405.NoRedirectshould always be set explicitly (even tofalse); omitting it can cause TIB to fail to process the request (observed on TIB v1.7.3).Test plan
quay.io/keycloak/keycloak:23.0) + standalone TIB (tykio/tyk-identity-broker:v1.7.3) + Tyk Gateway/Dashboard (v5.8.13) viatyk-self-managed-trial. Logged in as a Keycloak user through TIB, obtained a Tyk access token viaGenerateOAuthTokenForClient, and successfully called the protected API with it (200from httpbin;400without the token).scripts/validate_mintlify_docs.py . --check-anchors --links-onlylocally against the full repo: no broken links, no broken anchor fragments.validate-docs.ymlchecks manually; all pass.🤖 Generated with entirely Claude Code assistance, reviewed by Sharad.
PR Type
Documentation
Description
Add Keycloak TIB token example
Clarify
APIListenPathslash requirementsWarn to set
NoRedirectexplicitlyCross-link Keycloak SSO guidance
Diagram Walkthrough
File Walkthrough
issuing-tokens-via-tib.mdx
Add Keycloak token flow exampleapi-management/access-control/sessions-and-keys/issuing-tokens-via-tib.mdx
IdentityHandlerConfig.OAuth.APIListenPathmust exclude leadingand trailing slashes.
APIListenPathvalues can produce Gateway405errors.
IdentityHandlerConfig.OAuth.NoRedirectshould always be setexplicitly.
tokens via TIB.
sso-keycloak.mdx
Cross-link Keycloak docs to TIBtyk-identity-broker/sso-keycloak.mdx
IssuingTokens via TIB.ActionTypeand profile fields.