Skip to content

Conversation

brionmario
Copy link
Member

Purpose

This PR implements automatic Organization Discovery Strategies for the Asgardeo SDK, enabling seamless extraction of organization handles from URLs without manual configuration. The feature supports multiple discovery strategies (urlPath, urlQuery, subdomain, baseUrl, custom) and automatically injects the discovered organization into authentication requests as signInOptions={{ fidp: 'OrganizationSSO', orgId: '<discovered_org>' }}.

Key Features:

  • ✅ Strategy-based organization discovery system
  • ✅ Support for 5 discovery strategies with automatic fallback
  • ✅ React and Next.js client integration
  • ✅ Backward compatible - existing organizationHandle config takes precedence
  • ✅ TypeScript support with comprehensive type definitions
  • ✅ Graceful error handling and debugging support

Implementation Details:

  • Core discovery utility in @asgardeo/javascript package
  • Automatic integration in AsgardeoReactClient.initialize() method
  • Browser-safe URL parsing with SSR compatibility
  • Comprehensive error handling with console warnings
  • Loading state management fixes for React providers

Related Issues

Related PRs

  • N/A

Checklist

  • e2e cypress tests locally verified.
  • Manual test round performed and verified.
  • UX/UI review done on the final implementation.
  • Documentation provided. (Feature issue with comprehensive examples and usage patterns)
  • Unit tests provided. (Organization discovery utility tests)
  • Integration tests provided. (React client integration tests)

Security checks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant