feat: support for organization discovery strategies
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- express, typescript
- Domain
- authentication, backend
Research direction
Start by locating the organizationHandle configuration and signInOptions handling in the @asgardeo/express and @asgardeo/javascript packages. Review how each proposed URL strategy should extract a handle or ID and how the discovered value should enter authentication requests. Done means the strategies work across the listed URL patterns in both related packages.
Written by the indexing model from the issue text.
Description
Problem
Currently, Asgardeo SDK users need to manually specify the organizationHandle in their configuration when implementing B2B authentication flows. This creates several challenges:
- Manual Configuration: Developers must hardcode organization handles or implement custom logic to extract them from URLs
- Limited URL Support: No built-in support for common B2B URL patterns like:
- Path-based:
/o/{orgHandle}or/o/{orgId} - Query-based:
/?o={orgHandle}or/?o={orgId} - Subdomain-based:
{orgHandle}.example.com
- Path-based:
- Repetitive Implementation: Each application needs to implement similar organization extraction logic
- Error-Prone: Manual extraction is susceptible to bugs and inconsistencies across applications
Proposed Solution
Implement automatic Organization Discovery Strategies that can extract organization handles from URLs and automatically inject them into authentication requests as signInOptions={{ fidp: 'OrganizationSSO', orgId: '<discovered_org>' }}.
URL Path Strategy (urlPath):
- Extracts from patterns:
/o/{handle},/o/{id} - Example:
https://app.com/o/acme-corp→acme-corp
URL Query Strategy (urlQuery):
- Extracts from query parameters:
?o={handle},?org={handle} - Example:
https://app.com/?o=acme-corp→acme-corp
Subdomain Strategy (subdomain):
- Extracts from subdomain patterns:
{handle}.domain.com - Example:
https://acme-corp.app.com→acme-corp
Base URL Strategy (baseUrl):
- Extracts from the configured baseUrl pattern
- Example:
baseUrl: "https://api.asgardeo.io/t/acme-corp"→acme-corp
Alternatives
No response
Please select the package issue is related to
@asgardeo/express, @asgardeo/javascript
Version
0.1.12
Reporter Checklist
- I have searched the existing issues and this is not a duplicate.
- I have provided all the necessary information.
- I have verified the feature on the latest version of the package.
- Dominant language
- TypeScript
- Stars
- 18
- Forks
- 67
- Avg merge
- 4h 6m
- Merged PRs (30d)
- 13
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from asgardeo/javascript
-
Bug: SignInButton render prop usage in "react-tanstack-router" sample missing "onClick={signIn}" OpenType/Bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
asgardeo/javascript#572 ·
-
Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
asgardeo/javascript#571 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
asgardeo/javascript#485 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
asgardeo/javascript#527 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 56/100
asgardeo/javascript#522 · 2 comments ·
All issues in asgardeo/javascript
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·