@@ -176,18 +176,18 @@ public class AuthenticationAPIClient @VisibleForTesting(otherwise = VisibleForTe
176176 *
177177 * @param authSession the auth session received from the server as part of the public key challenge request.
178178 * @param authResponse the public key credential authentication response
179- * @param realm the default connection to use
179+ * @param realm the connection to use. If excluded, the application will use the default connection configured in the tenant
180180 * @return a request to configure and start that will yield [Credentials]
181181 */
182182 public fun signinWithPasskey (
183183 authSession : String ,
184184 authResponse : PublicKeyCredentials ,
185- realm : String
185+ realm : String? = null
186186 ): AuthenticationRequest {
187187 val params = ParameterBuilder .newBuilder().apply {
188188 setGrantType(ParameterBuilder .GRANT_TYPE_PASSKEY )
189189 set(AUTH_SESSION_KEY , authSession)
190- setRealm(realm)
190+ realm?. let { setRealm(it) }
191191 }.asDictionary()
192192
193193 return loginWithToken(params)
@@ -217,12 +217,12 @@ public class AuthenticationAPIClient @VisibleForTesting(otherwise = VisibleForTe
217217 * ```
218218 *
219219 * @param userData user information of the client
220- * @param realm default connection to use
220+ * @param realm the connection to use. If excluded, the application will use the default connection configured in the tenant
221221 * @return a request to configure and start that will yield [PasskeyRegistrationChallenge]
222222 */
223223 public fun signupWithPasskey (
224224 userData : UserData ,
225- realm : String
225+ realm : String? = null
226226 ): Request <PasskeyRegistrationChallenge , AuthenticationException > {
227227 val user = Gson ().toJsonTree(userData)
228228 val url = auth0.getDomainUrl().toHttpUrl().newBuilder()
@@ -232,7 +232,7 @@ public class AuthenticationAPIClient @VisibleForTesting(otherwise = VisibleForTe
232232
233233 val params = ParameterBuilder .newBuilder().apply {
234234 setClientId(clientId)
235- setRealm(realm)
235+ realm?. let { setRealm(it) }
236236 }.asDictionary()
237237
238238 val passkeyRegistrationChallengeAdapter: JsonAdapter <PasskeyRegistrationChallenge > =
@@ -261,11 +261,11 @@ public class AuthenticationAPIClient @VisibleForTesting(otherwise = VisibleForTe
261261 * })
262262 * ```
263263 *
264- * @param realm A default connection name
264+ * @param realm the connection to use. If excluded, the application will use the default connection configured in the tenant
265265 * @return a request to configure and start that will yield [PasskeyChallenge]
266266 */
267267 public fun passkeyChallenge (
268- realm : String
268+ realm : String? = null
269269 ): Request <PasskeyChallenge , AuthenticationException > {
270270 val url = auth0.getDomainUrl().toHttpUrl().newBuilder()
271271 .addPathSegment(PASSKEY_PATH )
@@ -274,7 +274,7 @@ public class AuthenticationAPIClient @VisibleForTesting(otherwise = VisibleForTe
274274
275275 val parameters = ParameterBuilder .newBuilder().apply {
276276 setClientId(clientId)
277- setRealm(realm)
277+ realm?. let { setRealm(it) }
278278 }.asDictionary()
279279
280280 val passkeyChallengeAdapter: JsonAdapter <PasskeyChallenge > = GsonAdapter (
0 commit comments