diff --git a/EXAMPLES.md b/EXAMPLES.md index cda63cedb..6597019d8 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -6,8 +6,10 @@ - [Specify scope](#specify-scope) - [Specify Connection scope](#specify-connection-scope) - [Specify Parameter](#specify-parameter) + - [Specify a Custom Authorize URL](#specify-a-custom-authorize-url) - [Customize the Custom Tabs UI](#customize-the-custom-tabs-ui) - [Changing the Return To URL scheme](#changing-the-return-to-url-scheme) + - [Specify a Custom Logout URL](#specify-a-custom-logout-url) - [Trusted Web Activity](#trusted-web-activity) - [Authentication API](#authentication-api) - [Login with database connection](#login-with-database-connection) @@ -95,6 +97,30 @@ WebAuthProvider.login(account) .start(this, callback) ``` +## Specify a Custom Authorize URL + +In scenarios where you need to use a specific authorize endpoint different from the one derived from your Auth0 domain (e.g., for custom domains, specific tenant configurations), you can provide a full custom URL to the `/authorize` endpoint. + +```kotlin +WebAuthProvider +.login(account) +.withAuthorizeUrl("https://YOUR_CUSTOM_TENANT_OR_AUTH_DOMAIN/authorize") +.start(this, callback) +``` + +
+ Using Java + +```java +WebAuthProvider +.login(account) +.withAuthorizeUrl("https://YOUR_CUSTOM_TENANT_OR_AUTH_DOMAIN/authorize") +.start(this, callback); +``` +
+ +The URL provided to `.withAuthorizeUrl()` must be a complete and valid HTTPS URL for an OAuth 2.0 authorize endpoint. The SDK will append standard OAuth parameters to this custom base URL. + ## Customize the Custom Tabs UI If the device where the app is running has a Custom Tabs compatible Browser, a Custom Tab will be preferred for the logout flow. You can customize the Page Title visibility, the Toolbar color, and the supported Browser applications by using the `CustomTabsOptions` class. @@ -134,6 +160,29 @@ WebAuthProvider.logout(account) .start(this, logoutCallback) ``` +## Specify a Custom Logout URL + +Similar to the authorize URL, you can specify a custom logout endpoint if your setup requires it (e.g., using custom domains or for specific logout behaviors configured in your Auth0 tenant). + +```kotlin +WebAuthProvider +.logout(account) +.withLogoutUrl("https://YOUR_CUSTOM_TENANT_OR_AUTH_DOMAIN/v2/logout") +.start(this, logoutCallback) +``` +
+ Using Java + +```java +WebAuthProvider +.logout(account) +.withLogoutUrl("https://YOUR_CUSTOM_TENANT_OR_AUTH_DOMAIN/v2/logout") +.start(this, logoutCallback); +``` +
+ +The URL provided to `.withLogoutUrl()` must be a complete and valid HTTPS URL for logout endpoint. The SDK will append standard logout parameters to this custom base URL. + ## Trusted Web Activity Trusted Web Activity is a feature provided by some browsers to provide a native look and feel to the custom tabs. @@ -1515,4 +1564,4 @@ The rules should be applied automatically if your application is using `minifyEn By default you should at least use the following files: * `proguard-okio.pro` * `proguard-gson.pro` -* `proguard-jetpack.pro` \ No newline at end of file +* `proguard-jetpack.pro`