Skip to content

Fix adding users when deployed as federated login to console - #4527

Merged
rajithacharith merged 1 commit into
thunder-id:mainfrom
rajithacharith:user-onboarding
Aug 3, 2026
Merged

Fix adding users when deployed as federated login to console#4527
rajithacharith merged 1 commit into
thunder-id:mainfrom
rajithacharith:user-onboarding

Conversation

@rajithacharith

@rajithacharith rajithacharith commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Purpose

Fix user creation on a resource-server instance that is federated to an authorization server (trusted issuer).

In the trusted-issuer model the Console's baseUrl points at the authorization server (IdP), so the SDK was sending the resource-server calls (user onboarding via /flow/execute, /flow/meta, /users/me) to the IdP instead of the resource server that owns the users. Creating a user therefore failed.

Approach

The @thunderid/javascript SDK now supports overriding the resource-server endpoints independently of the OAuth/discovery endpoints (via config.endpoints.flowExecute / flowMeta / usersMe). This PR wires that up on the Console side:

  • frontend/apps/console/src/hocs/withConfig.tsx — when config.trusted_issuer is set, derive the resource-server URL from getServerUrl() and pass endpoints: { flowExecute, flowMeta, usersMe } pointing at the resource server, while baseUrl continues to target the authorization server for OAuth/discovery.
  • pnpm-workspace.yaml / pnpm-lock.yaml — bump the SDK catalog to the released versions that include the endpoint-override support and the InviteUser onboarding fix (@thunderid/react 0.11.3, @thunderid/react-router 0.10.2).
  • docs/content/sdks/javascript/apis/configuration.mdx — document the resource-server endpoint overrides and the trusted-issuer scenario.

The change is additive: without trusted_issuer, getServerUrl() resolves to the served origin and behavior is unchanged.

Related Issues

Related PRs

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (docs/content/sdks/javascript/apis/configuration.mdx)
    • Ran Vale and fixed all errors and warnings
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards in WSO2 Secure Coding Guidelines
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Summary by CodeRabbit

  • New Features
    • Added support for configuring separate authentication and resource-server endpoint hosts.
    • Trusted-issuer deployments now automatically use configured resource-server endpoints for flow execution, flow metadata, and current-user profile requests.
  • Documentation
    • Documented endpoint configuration options and the distinction between OIDC/OAuth and resource-server endpoints.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 60240881-90ad-4562-a267-7c181334195f

📥 Commits

Reviewing files that changed from the base of the PR and between d99684c and a355cce.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • docs/content/sdks/javascript/apis/configuration.mdx
  • frontend/apps/console/src/hocs/withConfig.tsx
  • pnpm-workspace.yaml
🚧 Files skipped from review as they are similar to previous changes (3)
  • frontend/apps/console/src/hocs/withConfig.tsx
  • pnpm-workspace.yaml
  • docs/content/sdks/javascript/apis/configuration.mdx

📝 Walkthrough

Walkthrough

The console now configures resource-server endpoints for trusted-issuer deployments. SDK documentation describes the endpoint overrides, and workspace catalog versions are updated.

Changes

Trusted issuer endpoint configuration

Layer / File(s) Summary
SDK endpoint overrides and version alignment
docs/content/sdks/javascript/apis/configuration.mdx, pnpm-workspace.yaml
The documentation defines flowExecute, flowMeta, and usersMe overrides. The workspace updates the related SDK package versions.
Trusted issuer endpoint wiring
frontend/apps/console/src/hocs/withConfig.tsx
The HOC derives the resource-server URL and configures the SDK endpoints for trusted-issuer deployments. config.sdk can override these defaults.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant HOC as withConfig HOC
  participant SDK as ThunderID SDK
  participant RS as Resource Server
  HOC->>SDK: Configure flowExecute, flowMeta, and usersMe endpoints
  SDK->>RS: Send flow and user-profile requests
Loading

Possibly related PRs

Suggested reviewers: donomalvindula, jeradrutnam, brionmario

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the user-creation fix for federated-login Console deployments.
Description check ✅ Passed The description covers the purpose, approach, related issue, implementation details, documentation, and security checks.
Linked Issues check ✅ Passed The changes route onboarding requests to the resource server for trusted issuers and address issue #4465.
Out of Scope Changes check ✅ Passed The Console configuration, SDK version updates, and documentation directly support the linked issue and stated objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

docs/content/sdks/javascript/apis/configuration.mdx

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

frontend/apps/console/src/hocs/withConfig.tsx

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/content/sdks/javascript/apis/configuration.mdx`:
- Around line 95-98: Replace both prose occurrences of the hardcoded “ThunderID”
product name in the configuration guidance with the <ProductName /> component,
while keeping SDK identifiers and any content inside fenced code blocks
unchanged.
- Around line 90-93: Update the endpoint documentation paragraph to remove
endpoints.wellKnown from the list described as resolved from the discovery
document, while retaining it as an override for the discovery document URL. Keep
the remaining OIDC/OAuth endpoint descriptions and resource-server endpoint
descriptions unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 577a0a3c-0142-4b3e-a059-627125985d41

📥 Commits

Reviewing files that changed from the base of the PR and between a2a4aee and d99684c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • docs/content/sdks/javascript/apis/configuration.mdx
  • frontend/apps/console/src/hocs/withConfig.tsx
  • pnpm-workspace.yaml

Comment thread docs/content/sdks/javascript/apis/configuration.mdx Outdated
Comment on lines +95 to +98
Split these two groups when the OAuth authorization server and the ThunderID resource server are different hosts, for
example when two ThunderID instances are connected as trusted issuers. Point `baseUrl` (and hence the OAuth/discovery
endpoints) at the authorization server, and override the resource-server endpoints to target the resource server that
owns the users and flows:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Replace hardcoded product names in prose.

🔴 Hardcoded product name: ThunderID must use <ProductName /> in these prose lines. Replace both occurrences. Keep SDK identifiers inside fenced code blocks unchanged.

As per path instructions, prose in docs/** must render product names with <ProductName />. Based on learnings, SDK identifiers in code blocks must remain literal.

🧰 Tools
🪛 GitHub Actions: 🥒 Docs Lint (Changed Files Only) / 0_Docs lint.txt

[error] 95-96: Structural docs lint error: hardcoded 'ThunderID' in prose; use instead. Command './scripts/docs-lint.sh' failed with exit code 1.

🪛 GitHub Actions: 🥒 Docs Lint (Changed Files Only) / Docs lint

[error] 95-95: Structural docs lint error: hardcoded 'ThunderID' in prose; use instead.


[error] 96-96: Structural docs lint error: hardcoded 'ThunderID' in prose; use instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/content/sdks/javascript/apis/configuration.mdx` around lines 95 - 98,
Replace both prose occurrences of the hardcoded “ThunderID” product name in the
configuration guidance with the <ProductName /> component, while keeping SDK
identifiers and any content inside fenced code blocks unchanged.

Sources: Path instructions, Learnings

@rajithacharith rajithacharith added the trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes label Aug 3, 2026
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@rajithacharith
rajithacharith added this pull request to the merge queue Aug 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 3, 2026
@rajithacharith
rajithacharith added this pull request to the merge queue Aug 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 3, 2026
@rajithacharith
rajithacharith added this pull request to the merge queue Aug 3, 2026
Merged via the queue into thunder-id:main with commit 7dcfbbb Aug 3, 2026
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes Type/Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to create users when two Thunder instances are connected as trusted issuers

2 participants