Repository navigation
Add the Wayfinder Enterprise B2B sample - #25
Merged
AnuradhaSK merged 1 commit intoNov 13, 2026
Merged
Conversation
5 of 12 tasks
5 of 11 tasks
AnuradhaSK
force-pushed
the
add-wayfinder-enterprise-sample
branch
5 times, most recently
from
November 13, 2026 02:35
01dc4f1 to
5d3b905
Compare
Moves the sample from the ThunderID repository into a new b2b area, switches it to npm and the published @thunderid/nextjs release, and adds its banner, README index row and release workflow input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: AnuradhaSK <anuradha199528@gmail.com>
AnuradhaSK
force-pushed
the
add-wayfinder-enterprise-sample
branch
from
November 13, 2026 03:06
5d3b905 to
eb22ec4
Compare
brionmario
approved these changes
Nov 13, 2026
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Adds the first B2B sample, Wayfinder Enterprise: a Next.js travel management app where every customer company is an organization unit (OU) in ThunderID. The app, its roles and its sign-in flow are defined once in a root OU and shared with every company, so a company can use the app as soon as it registers.
The sample shows how to:
Wayfinder Admin, and signs the admin in to the app.enterpriseIdpflow variable. On their first sign-in, employees are added to the company as members.@thunderid/nextjscomponents.thunderid-config/create every ThunderID resource the app needs, with fixed IDs.It also adds a
b2barea to the repository:AGENTS.md.B2B SAMPLEbadge in thesample-bannerskill, and the sample's banner.sample_b2b_wayfinder_enterpriseinput in the release workflow.The PR builder finds the sample through its
package.json, so it is built and linted without any workflow change.Screenshots
Approach
Resource model. The
Wayfinder Enterpriseroot OU owns the application, the backend client, both roles, both flows and the user type. The application, the two roles and the sign-in flow have a sharing policy for every child OU. Each company is a child OU and holds only its own users, groups and identity provider.Choosing the company at sign-in. The app is shared with every company, so a sign-in has to settle on one company before ThunderID issues a token:
OUResolverExecutorfinds the company from the handle before the user authenticates.OUResolverExecutor(directChildrenOnly) runs after authentication. It picks the user's company, and asks the user to choose when they belong to more than one.Security design.
User tokens are issued for the app's own resource server (
urn:wayfinder-enterprise:api) and carry only Wayfinder permissions. They are never sent to the ThunderID management API. This keeps the app working whenserver.security.rest.audienceis enabled. For the same reason, the SDK reads the user profile from the ID token (fetchUserProfile: false).The admin components call the app's
/api/admin/[...path]route, which:viewto read andmanageto change, onuser,group,roleorsso. OnlyWayfinder Adminhas these permissions.ouId.Wayfinder Enterprise Backendclient, issued for the caller's company. The token comes fromPOST /ou/{ouId}/oauth2/token(client_credentials) and is cached per company.The route exists because roles, connections, flows and flow variables have no OU-scoped permission today. Managing them needs the root
systempermission, which company admins must not hold. If OU-scoped permissions for these resources are added later, the route can be made smaller.Two import files. The Console tests an import before running it. That test does not create organization units, but it still looks up the organization unit that resource servers, roles and flows are placed in. So
organization-unit.yamlhas to be imported first, on its own.Other choices.
@thunderid/nextjs1.18.1.data/wayfinder.json, so no database is needed. The README notes that two changes made at the same moment can overwrite each other.Related Issues
Related PRs
Checklist
b2b/wayfinder-enterprise/README.md)breaking changelabel added.Security checks
🤖 Generated with Claude Code