PublicClientNext is an early look at the planned implementation of PublicClientApplication in the next major version of MSAL.js. It contains support for multiple API implementations based on the runtime environment that it is running in.

The goals of these changes are to provide a clean separation of behavior between different operating contexts (Nested App Auth, Platform Brokers, Plain old Browser, etc.) while still providing a consistent API surface for developers.

Please use PublicClientApplication for any prod/real-world scenarios. Note: PublicClientNext is experimental and subject to breaking changes without following semver

Hierarchy

  • PublicClientNext

Implements

Methods

  • Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects the page, so any code that follows this function will not execute.

    IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.

    Parameters

    Returns Promise<void>

  • Event handler function which allows users to fire events after the PublicClientApplication object has loaded during redirect flows. This should be invoked on all page loads involved in redirect auth flows.

    Parameters

    • Optional hash: string

      Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.

    Returns Promise<null | AuthenticationResult>

    Token response or null. If the return value is null, then no auth redirect was detected.

  • Use when initiating the login process by redirecting the user's browser to the authorization endpoint. This function redirects the page, so any code that follows this function will not execute.

    IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.

    Parameters

    Returns Promise<void>

  • This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:

    • Any browser using a form of Intelligent Tracking Prevention
    • If there is not an established session with the service

    In these cases, the request must be done inside a popup or full frame redirect.

    For the cases where interaction is required, you cannot send a request with prompt=none.

    If your refresh token has expired, you can use this function to fetch a new set of tokens silently as long as you session on the server still exists.

    Parameters

    Returns Promise<AuthenticationResult>

    A promise that is fulfilled when this function has completed, or rejected if an error was raised.

Generated using TypeDoc