Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Each topic lives in its own file under [`examples/`](examples).
- [Ephemeral Browsing](examples/ephemeral-browsing.md)
- [Auth Tab](examples/auth-tab.md)
- [DPoP](examples/dpop.md)
- [Experiment Center](examples/experiment-center.md)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
- [Handling Configuration Changes During Authentication](examples/configuration-changes.md)

## Authentication API
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,25 @@ WebAuthProvider.login(account)
.await(this)
```

### Experiment Center

> [!NOTE]
> Experiment Center support via SDKs is currently in Early Access. To request access to this feature, contact your Auth0 representative.

[Experiment Center](https://auth0.com/docs/customize/experiment-center/overview) is Auth0's A/B testing platform for authentication flows. Pass `experiment_id`, `variation_id`, and optionally `segment_id` via `withParameters()` to force a specific variation on a Web Auth login request:

```kotlin
WebAuthProvider.login(account)
.withParameters(mapOf(
"experiment_id" to "<EXPERIMENT_ID>",
"variation_id" to "<VARIATION_ID>",
"segment_id" to "<SEGMENT_ID>" // optional
))
.start(this, callback)
```

See the [full usage example](examples/experiment-center.md) for coroutine and Java samples.

## Credentials Manager

This library ships with two additional classes that help you manage the Credentials received during authentication.
Expand Down
54 changes: 54 additions & 0 deletions examples/experiment-center.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Experiment Center

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in beta. We should also add that note here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


[Experiment Center](https://auth0.com/docs/customize/experiment-center/overview) is Auth0's A/B testing platform for authentication flows. It lets you split traffic across variants, measure results, and promote the winner — all inside Auth0.

Pass `experiment_id`, `variation_id`, and optionally `segment_id` via `withParameters()` to force a user into a specific variation for the login request, bypassing the server-side deterministic assignment. All three IDs are obtained from your Auth0 Dashboard or the Management API:

- `experiment_id` — the ID of the experiment to target
- `variation_id` — the specific variation to assign to this user
- `segment_id` — _(optional)_ restricts the override to a particular audience segment within the experiment

```kotlin
WebAuthProvider.login(account)
.withParameters(mapOf(
"experiment_id" to "<EXPERIMENT_ID>",
"variation_id" to "<VARIATION_ID>",
"segment_id" to "<SEGMENT_ID>" // optional
))
.start(this, callback)
```

<details>
<summary>Using coroutines</summary>

```kotlin
WebAuthProvider.login(account)
.withParameters(mapOf(
"experiment_id" to "<EXPERIMENT_ID>",
"variation_id" to "<VARIATION_ID>",
"segment_id" to "<SEGMENT_ID>" // optional
))
.await(this)
```

</details>

<details>
<summary>Using Java</summary>

```java
WebAuthProvider.login(account)
.withParameters(new HashMap<String, Object>() {{
put("experiment_id", "<EXPERIMENT_ID>");
put("variation_id", "<VARIATION_ID>");
put("segment_id", "<SEGMENT_ID>"); // optional
}})
.start(this, callback);
```

</details>

> [!NOTE]
> Experiment Center is an Enterprise feature, and support via SDKs is currently in Early Access. To request access to this feature, contact your Auth0 representative. The override only applies to the current request — the next login without these parameters reverts to server-side deterministic assignment. Refer to the [Experiment Center documentation](https://auth0.com/docs/customize/experiment-center/overview) for setup instructions.
>
> Only `WebAuthProvider` login reaches Experiment Center. Embedded/native login and ROPG skip `/authorize` entirely and do not support experiment overrides.
Loading