/** * Authentication Module * * Provides comprehensive authentication, authorization, and identity management: * - Core auth context, hooks, and services * - Active Directory integration (Azure AD, ADFS, on-prem) * - Role-Based Access Control (RBAC) * * @module auth * * @example Basic Authentication * ```tsx * import { AuthProvider, useAuth, authService } from '@/lib/auth'; * * function App() { * return ( * * * * ); * } * * function LoginButton() { * const { login, isAuthenticated, user } = useAuth(); * * if (isAuthenticated) { * return Welcome, {user.name}; * } * * return ; * } * ``` * * @example Active Directory Integration * ```tsx * import { ADProvider, useActiveDirectory } from '@/lib/auth/active-directory'; * * function App() { * return ( * * * * ); * } * ``` * * @example RBAC Access Control * ```tsx * import { RBACProvider, useRBAC } from '@/lib/auth/rbac'; * * function SecureComponent() { * const { can, canAny, hasRole } = useRBAC(); * * if (hasRole('admin')) { * return ; * } * * if (can('read', 'documents')) { * return ; * } * * return ; * } * ``` */ export { AuthProvider, useAuthContext } from './AuthProvider'; export { useAuth, useHasRole, useHasPermission } from './useAuth'; export { authService } from './authService'; export * from './authGuards'; export { routeMetadata, getRouteAuthConfig, canAccessRoute } from './routeMetadata'; export type { User, Role, Permission, AuthTokens, LoginCredentials, RegisterCredentials, AuthState, AuthContextValue, RouteAuthConfig, } from './types'; export * as activeDirectory from './active-directory'; export { ADProvider, ADContext, type ADProviderProps, useActiveDirectory, ADClient, createADClient, ADTokenHandler, createTokenHandler, type TokenHandlerOptions, type AcquisitionOptions, SSOManager, createSSOManager, CrossDomainSSO, createCrossDomainSSO, type SSOEventType, type SSOBroadcastMessage, type SSOEventHandler, type SSOManagerOptions, ADGroupMapper, createGroupMapper, mergeGroupMappings, validateGroupMapping, GROUP_MAPPING_PRESETS, type GroupMappingResult, ADAttributeMapper, createAttributeMapper, DEFAULT_ATTRIBUTE_MAPPINGS, type AttributeMapping, type AttributeMappingResult, getAuthorityUrl, getConfiguredScopes, validateADConfig, DEFAULT_AD_CONFIG, DEFAULT_AZURE_AD_CONFIG, DEFAULT_ADFS_CONFIG, DEFAULT_AZURE_B2C_CONFIG, DEFAULT_ON_PREMISES_CONFIG, DEFAULT_SSO_CONFIG, DEFAULT_GROUP_MAPPING_CONFIG, type ADProviderType, type ADConfig, type AzureADConfig, type AzureADB2CConfig, type ADFSConfig, type OnPremisesADConfig, type ADTokens, type ADUser, type ADGroup, type SSOConfig, type SSOSession, type ADGroupRoleMapping, type ADGroupMappingConfig, type TokenAcquisitionRequest, type TokenRefreshResult, type ADAuthError, type ADAuthState, type ADContextValue, } from './active-directory'; export * as rbac from './rbac'; export { RBACProvider, RBACContext, type RBACProviderProps, useRBAC, usePermissions, useRoles, useResourceAccess, usePermissionGate, useRoleGate, useAccessChecks, type UseRBACReturn, RBACEngine, createRBACEngine, PermissionMatrixBuilder, createPermissionMatrixBuilder, createStandardMatrix, createHealthcareMatrix, mergePermissionMatrices, filterEntriesByRole, filterEntriesByResource, getDefinedResources, getDefinedRoles, validatePermissionMatrix, PERMISSION_ACTIONS, CRUD_ACTIONS, READ_ONLY_ACTIONS, FULL_ACCESS_ACTIONS, RoleHierarchyManager, createRoleHierarchy, STANDARD_ROLE_HIERARCHY, HEALTHCARE_ROLE_HIERARCHY, ResourcePermissionManager, createResourcePermissionManager, levelGrantsAction, getMinimumLevelForAction, comparePermissionLevels, PERMISSION_LEVELS, LEVEL_ACTIONS, PolicyEvaluator, createPolicyEvaluator, type EvaluationContext, type PermissionAction, type PermissionScope, type StructuredPermission, type PermissionCondition, type RoleDefinition, type RoleAssignment, type RoleHierarchy, type PermissionMatrix, type PermissionMatrixEntry, type Policy, type PolicySet, type PolicyEffect, type PolicyResult, type PolicySubject, type PolicyResource, type PolicyCondition, type AccessRequest, type RequestContext, type EvaluationResult, type Obligation, type ResourcePermission, type ResourceACL, type RBACConfig, type RBACState, type RBACContextValue, type RBACAuditEvent, type RBACAuditHandler, } from './rbac';