Nevis Mobile Authentication SDK React Native plugin
    Preparing search index...

    Class UpdateServerAbstract

    The object that can be used to update the Server associated with a given user account.

    This is a local-only operation: no network calls are made.

    This operation can be used in different scenarios:

    • Domain migration: when the domain of the server where the account is stored changes, the operation can be used to use the new domain (see UpdateServer.newBaseUrl).
    • High availability scenarios: when you want to allow the SDK to perform its out-of-band operations in multiple servers, the operation can be used to define all the base URLs accepted by the SDK for a given account (see UpdateServer.newAlternativeBaseUrls).
    • Use separate domains for out-of-band registration and authentication: by using UpdateServer.newAlternativeBaseUrls, the SDK will support the case where different domains are used in the redemption URLs defined in nevisFIDO. The SDK will use the redemption URL to perform the out-of-band operation.

    Usage example:

     await client.localData.updateServerOperation
    .username(username)
    .newBaseUrl(newBaseUrl)
    .newAlternativeBaseUrls(alternativeBaseUrls)
    .execute();
    Note

    The old base URL is not added to the alternative base URLs automatically. If out-of-band links with the old domain must still be accepted after changing the base URL with UpdateServer.newBaseUrl, include it in UpdateServer.newAlternativeBaseUrls.

    Note

    The update is applied to the registrations of the account and to its device information. If it fails, the registrations are restored, so both keep referring to the same server. Concurrent executions are serialized.

    Index
    • Specifies the username whose Server must be updated.

      Important

      Providing the username is required.

      Warning

      The username is the technical user identifier stored in the Account.username property. Do not provide the login identifier (for example the user's email address) here. We recommend always using the username provided via LocalData.accounts.

      Parameters

      • username: string

        the username.

      Returns UpdateServer

      the UpdateServer object.

    • Specifies the alternative base URLs of the server. If not provided, the alternative base URLs of the Server associated with the account will not be changed.

      Important

      Providing at least one of the UpdateServer.newBaseUrl or UpdateServer.newAlternativeBaseUrls is required.

      Note

      When provided, this replaces the account's entire current set of alternative base URLs. It does not extend or merge with it. To add a new alternative base URL while keeping the existing ones, pass the full desired set, including the URLs already associated with the account (see Server.alternativeBaseUrls).

      The alternative base URLs are used for out-of-band operations. If the redeem URL of an out-of-band payload has a base URL matching one of the alternative base URLs, then the SDK will use that base URL to perform the out-of-band operation.

      The alternative base URLs are also used for in-band registration when there is already an authenticator for the user being registered. The SDK will accept to use any of the alternative base URLs to do the operation (see Registration.serverUrl).

      Parameters

      • newAlternativeBaseUrls: Set<string>

        the alternative base URLs.

      Returns UpdateServer

      the UpdateServer object.

    • Executes the update asynchronously.

      Updates the Server associated with the account of the provided username in the local SDK state.

      Returns Promise<void>