Skip to content

Latest commit

 

History

History
164 lines (118 loc) · 9.75 KB

File metadata and controls

164 lines (118 loc) · 9.75 KB

@forgerock/journey-client

2.0.1

Patch Changes

  • Updated dependencies [d849256]:
    • @forgerock/sdk-request-middleware@2.0.1
    • @forgerock/storage@2.0.1
    • @forgerock/sdk-logger@2.0.1
    • @forgerock/sdk-oidc@2.0.1
    • @forgerock/sdk-types@2.0.1
    • @forgerock/sdk-utilities@2.0.1

2.0.0

Major Changes

  • #524 4c17ba5 Thanks @ryanbas21! - BREAKING CHANGE: Journey client methods now return GenericError instead of undefined for error cases.

    What Changed

    The start, next, resume, and terminate methods now return a GenericError object instead of undefined when encountering unknown step types or error conditions. This aligns the journey client with the DaVinci client's error handling patterns.

    Return Type Changes

    Method Before After
    start JourneyStep | JourneyLoginSuccess | JourneyLoginFailure | undefined JourneyStep | JourneyLoginSuccess | JourneyLoginFailure | GenericError
    next JourneyStep | JourneyLoginSuccess | JourneyLoginFailure | undefined JourneyStep | JourneyLoginSuccess | JourneyLoginFailure | GenericError
    resume JourneyStep | JourneyLoginSuccess | JourneyLoginFailure | undefined JourneyStep | JourneyLoginSuccess | JourneyLoginFailure | GenericError
    terminate void void | GenericError

    Migration Guide

    Before:

    const step = await client.start();
    if (step) {
      // Use step
    }
    
    After: const result = await client.start();
    if ('error' in result) {
      // Handle error
      console.error(result.message);
    } else {
      // Use step
    }
  • #502 9ad4062 Thanks @ryanbas21! - releasing version 2 of the ping javascript sdk

  • #525 9a8ca14 Thanks @ryanbas21! - BREAKING: Unify journey-client around wellknown-only configuration

    This release simplifies the configuration API by requiring the wellknown URL and automatically inferring baseUrl and realmPath.

    Breaking Changes

    • Removed baseUrl from JourneyServerConfig: The baseUrl is now always inferred from the wellknown URL. If inference fails (non-AM server), an error is returned.
    • Removed hasWellknownConfig export: This type guard is no longer needed since all configs use wellknown.

    Migration

    Before:

    journey({
      config: {
        serverConfig: { baseUrl: 'https://am.example.com/am/' },
        realmPath: 'alpha',
      },
    });

    After:

    journey({
      config: {
        serverConfig: {
          wellknown: 'https://am.example.com/am/oauth2/alpha/.well-known/openid-configuration',
        },
        // realmPath is now optional - inferred from wellknown issuer
      },
    });

    Features

    • Automatic baseUrl inference from wellknown URL (extracts path before /oauth2/)
    • Automatic realmPath inference from wellknown issuer
    • Improved error messages for non-AM servers, guiding users to appropriate clients
    • Updated README with comprehensive API documentation

Minor Changes

  • #527 bca228e Thanks @ancheetah! - Expose return types for clients

  • #525 9a8ca14 Thanks @ryanbas21! - ### @forgerock/journey-client

    Add well-known OIDC endpoint discovery support. The journey client can now fetch configuration from the .well-known/openid-configuration endpoint. The realm path can be automatically inferred from the well-known issuer URL.

    @forgerock/sdk-oidc

    Add shared well-known module with RTK Query API for OIDC endpoint discovery:

    • wellknownApi - RTK Query API for fetching well-known configuration
    • createWellknownSelector - Selector factory for cached well-known data
    • createWellknownError - Typed error creation from fetch failures
    • Re-exports pure utilities from @forgerock/sdk-utilities

    @forgerock/sdk-utilities

    Add pure well-known utilities:

    • inferRealmFromIssuer - Extract realm path from AM issuer URLs
    • isValidWellknownUrl - Validate well-known URLs (HTTPS required, HTTP allowed for localhost)

    @forgerock/davinci-client

    Refactored to use shared well-known module from @forgerock/sdk-oidc.

    @forgerock/oidc-client

    Refactored to use shared well-known module from @forgerock/sdk-oidc.

Patch Changes

  • #500 e99b374 Thanks @ancheetah! - Add support for KBA allowUserDefinedQuestions flag

  • #544 15b8329 Thanks @ancheetah! - Removed duplicate middleware config and added support for typed middleware

  • Updated dependencies [3c63979, ad81c13, 9ad4062, 9a8ca14, 5a9ea40]:

    • @forgerock/sdk-utilities@2.0.0
    • @forgerock/storage@2.0.0
    • @forgerock/sdk-logger@2.0.0
    • @forgerock/sdk-oidc@2.0.0
    • @forgerock/sdk-request-middleware@2.0.0
    • @forgerock/sdk-types@2.0.0

1.3.0

Minor Changes

  • #412 b0f4368 Thanks @ryanbas21! - feat: Implement new journey client

    • Implemented a new journey() factory function for creating stateful client instances.
    • Integrated Redux Toolkit and RTK Query for robust state management and API interactions.
    • Refactored resume logic to correctly persist and retrieve plain Step payloads, resolving prototype loss issues during serialization.
    • Improved error handling and type safety within the client.
    • Updated internal callback handling and device profiling integration.
  • #412 b0f4368 Thanks @ryanbas21! - feat(journey-client): Add WebAuthn, QR Code, and Recovery Code support

    • Introduces new utility modules (FRWebAuthn, FRQRCode, FRRecoveryCodes) to handle advanced authentication methods within authentication journeys.
    • Adds comprehensive parsing and handling for WebAuthn registration and authentication steps, including a fix for a type error where TextOutputCallback was being incorrectly inferred as TextInputCallback.
    • Implements support for displaying QR codes (for both OTP and Push) and for displaying and using recovery codes.
    • Includes extensive unit tests for the new callback types and utility modules to ensure correctness.
    • Updates documentation to reflect the new capabilities and architectural changes.

Patch Changes