overrideLoginServerIfNeeded

open fun overrideLoginServerIfNeeded(loginServer: String, @Nullable instanceServer: String, @Nullable communityId: String, @Nullable communityUrl: String): URI

Selects the server URI to target for token endpoint requests. Precedence: communityUrl >instanceServer >loginServer. instanceServer is populated only after the first token response, so a null instanceServer naturally identifies the code-exchange path which must target the login pool.

Return

The URI to use as the token endpoint base.

Parameters

loginServer

Login server URL string (fallback, never null).

instanceServer

Instance server URL string, or null if not yet known.

communityId

Community ID, or null if not a community user.

communityUrl

Community URL string, or null if not a community user.


Selects the server URI to target for token endpoint requests for the given user account. Precedence: communityUrl >instanceServer >loginServer.

Return

The URI to use as the token endpoint base.

Parameters

userAccount

User account whose server fields are used.