Skip to content

Commit 495d1a9

Browse files
authored
Update EXAMPLES.md for custom authorize url and custom logout url (#830)
1 parent ad7f5ba commit 495d1a9

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

EXAMPLES.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
- [Specify scope](#specify-scope)
77
- [Specify Connection scope](#specify-connection-scope)
88
- [Specify Parameter](#specify-parameter)
9+
- [Specify a Custom Authorize URL](#specify-a-custom-authorize-url)
910
- [Customize the Custom Tabs UI](#customize-the-custom-tabs-ui)
1011
- [Changing the Return To URL scheme](#changing-the-return-to-url-scheme)
12+
- [Specify a Custom Logout URL](#specify-a-custom-logout-url)
1113
- [Trusted Web Activity](#trusted-web-activity)
1214
- [Authentication API](#authentication-api)
1315
- [Login with database connection](#login-with-database-connection)
@@ -95,6 +97,30 @@ WebAuthProvider.login(account)
9597
.start(this, callback)
9698
```
9799

100+
## Specify a Custom Authorize URL
101+
102+
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.
103+
104+
```kotlin
105+
WebAuthProvider
106+
.login(account)
107+
.withAuthorizeUrl("https://YOUR_CUSTOM_TENANT_OR_AUTH_DOMAIN/authorize")
108+
.start(this, callback)
109+
```
110+
111+
<details>
112+
<summary>Using Java</summary>
113+
114+
```java
115+
WebAuthProvider
116+
.login(account)
117+
.withAuthorizeUrl("https://YOUR_CUSTOM_TENANT_OR_AUTH_DOMAIN/authorize")
118+
.start(this, callback);
119+
```
120+
</details>
121+
122+
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.
123+
98124
## Customize the Custom Tabs UI
99125

100126
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)
134160
.start(this, logoutCallback)
135161
```
136162

163+
## Specify a Custom Logout URL
164+
165+
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).
166+
167+
```kotlin
168+
WebAuthProvider
169+
.logout(account)
170+
.withLogoutUrl("https://YOUR_CUSTOM_TENANT_OR_AUTH_DOMAIN/v2/logout")
171+
.start(this, logoutCallback)
172+
```
173+
<details>
174+
<summary>Using Java</summary>
175+
176+
```java
177+
WebAuthProvider
178+
.logout(account)
179+
.withLogoutUrl("https://YOUR_CUSTOM_TENANT_OR_AUTH_DOMAIN/v2/logout")
180+
.start(this, logoutCallback);
181+
```
182+
</details>
183+
184+
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.
185+
137186
## Trusted Web Activity
138187

139188
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
15151564
By default you should at least use the following files:
15161565
* `proguard-okio.pro`
15171566
* `proguard-gson.pro`
1518-
* `proguard-jetpack.pro`
1567+
* `proguard-jetpack.pro`

0 commit comments

Comments
 (0)