Domain Migration and Alternative Server URLs
Each registered Account java, swift, objc, flutter, react native, has an associated Server java, swift, objc, flutter, react native where the Account is registered. The Nevis Mobile Authentication SDK stores the URL of the server. This URL is called the base URL. The SDK uses it for the in-band operations of the Account.
A Server can also have alternative base URLs java, swift, objc, flutter, react native. These are further URLs of the same backend that the SDK accepts for out-of-band operations. By default, a Server has no alternative base URLs.
The mobile application can update the base URL and the alternative base URLs of the Server associated with an Account locally. Existing accounts can then use new server URLs without registering again.
Each account has exactly one associated server. For brevity, the rest of this document refers to the base URL and the alternative base URLs "of an account" as shorthand for the base URL and the alternative base URLs of the server associated with that account.
Use the UpdateServer java, swift, objc, flutter, react native API to update the base URL and alternative base URLs of a given account. Example:
- Android/Kotlin
- Android/Java
- iOS/Swift
- iOS/Objective-C
- Flutter/Dart
- React Native/TypeScript
loading...
loading...
loading...
loading...
loading...
loading...
- The update is local. The SDK does not contact the backend, and it does not change the AppID, the redemption URLs or any other backend data.
- The new alternative base URLs replace the existing ones. The previous base URL is not kept automatically: add it to the alternative base URLs if it is still needed.
- To revert an update, update the account again with the previous values.
- This feature is available as of the native mobile SDK version
4.7.0, Flutter4.8.0and React Native5.4.0. - The feature is supported with the Identity Suite backend.
- The Nevis Access App does not support this feature yet.
Use Cases
Updating the server URLs of an account supports the following use cases:
- Domain migration: all accounts move from an old domain to a new domain.
- Separate registration and authentication domains: out-of-band registration uses a different domain than the other operations.
- High availability for out-of-band operations: the out-of-band payloads can contain the URL of any of several sites of the same backend.
- Moving individual users to another backend.
- Reverting or cleaning up previous updates.
For the end-to-end procedures, including the required backend changes, see Domain Migration and Alternative Server URLs in the Configuration Guide.
How the SDK Selects the URL
| Operation | URL used by the SDK |
|---|---|
| Retrieval of the facets | The application ID (AppID) sent by the backend. |
| In-band authentication, deregistration and device information change | The base URL of the account. |
| Out-of-band registration and authentication | The redemption URL in the out-of-band payload. For an existing account, the base URL derived from the redemption URL must match the base URL or one of the alternative base URLs of the account (see URL Matching Rules). |
| In-band registration | The server URL specified for the registration or, if none is specified, the base URL of the SDK configuration. |
The following diagram shows an account with the base URL https://auth.siven.ch and the alternative base URL https://login.siven.ch.
Registration
- The first registration of a user determines the base URL of the account:
- For in-band registration, this is the server URL specified for the registration or, if none is specified, the base URL of the SDK configuration.
- For out-of-band registration, this is the base URL derived from the redemption URL.
- Further registrations of the same user do not change the base URL or the alternative base URLs.
- For an existing account, the SDK accepts out-of-band payloads, and in-band registrations with an explicit server URL, only if the URL matches the base URL or one of the alternative base URLs. Otherwise, the SDK returns the
UserNotRegisteredInServerjava, swift, objc, flutter, react native error for authentication and theUserAlreadyRegisteredInAnotherServerjava, swift, objc, flutter, react native error for registration.
URL Matching Rules
- Two URLs match only if they are identical. A single trailing slash is ignored. For example,
https://siven.chandhttps://siven.ch:443do not match. - The SDK derives a base URL from a redemption URL or from the server URL of a registration. It takes the host and port of that URL, and appends the path of the base URL in the SDK configuration (see Multiple Backend Support). Define the alternative base URLs in the same format. For example, if the configured base URL is
https://login.siven.ch/nevisfido, the alternative base URL forauth.siven.chishttps://auth.siven.ch/nevisfido. - The base URLs and alternative base URLs set with
UpdateServermust have the same path as the base URL in the SDK configuration. The relative paths of the endpoints are also defined in the SDK configuration, and apply to all accounts. Only the host and the port can differ between accounts and between backends. - The SDK considers two accounts to belong to the same backend only if they have at least one URL in common. Use the same base URL for all accounts of a backend.
Restrictions and Limitations
- The limitations of multiple backend support apply: usernames must be unique across backends, and all backends must have the same endpoint structure and the same Firebase Cloud Messaging configuration.
- The endpoint paths cannot be changed per account. If the new URLs use different endpoint paths than the old ones, the application must update all accounts on the device and start using the SDK configuration with the new base URL and endpoint paths at the same time. See If the Endpoint Paths Differ in the Configuration Guide.
- In-band authentication, deregistration and device information change always use the base URL. The SDK does not fall back to an alternative base URL if the base URL is not reachable.
- The SDK always retrieves the facets from the AppID URL, so its host must be reachable.
- If the AppID is changed in the backend, the application must use an SDK version that supports AppID changes: native Mobile SDK version
4.7.0, Flutter4.8.0and React Native5.4.0or later. With older iOS SDK versions, the existing credentials can no longer be used. - The SDK does not validate the URLs set by the application. Only set URLs of trusted servers (see Blocking Servers).
- An update does not affect accounts that are registered later. The application must also update these accounts, for example by checking all accounts at every start.