Skip to content

Commit bdf9fb8

Browse files
committed
Removed the client side validation
1 parent c3be416 commit bdf9fb8

File tree

3 files changed

+0
-148
lines changed

3 files changed

+0
-148
lines changed

auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import com.auth0.android.request.internal.GsonAdapter.Companion.forMapOf
2424
import com.auth0.android.request.internal.GsonProvider
2525
import com.auth0.android.request.internal.RequestFactory
2626
import com.auth0.android.request.internal.ResponseUtils.isNetworkError
27-
import com.auth0.android.request.internal.validator.CustomTokenExchangeValidator
2827
import com.auth0.android.result.Challenge
2928
import com.auth0.android.result.Credentials
3029
import com.auth0.android.result.DatabaseUser
@@ -770,7 +769,6 @@ public class AuthenticationAPIClient @VisibleForTesting(otherwise = VisibleForTe
770769
organization: String? = null
771770
): AuthenticationRequest {
772771
return tokenExchange(subjectTokenType, subjectToken, organization)
773-
.addValidator(CustomTokenExchangeValidator())
774772
}
775773

776774
/**

auth0/src/main/java/com/auth0/android/request/internal/validator/CustomTokenExchangeValidator.kt

Lines changed: 0 additions & 60 deletions
This file was deleted.

auth0/src/test/java/com/auth0/android/authentication/AuthenticationAPIClientTest.kt

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -2378,92 +2378,6 @@ public class AuthenticationAPIClientTest {
23782378
assertThat(credentials, Matchers.`is`(Matchers.notNullValue()))
23792379
}
23802380

2381-
@Test
2382-
public fun shouldFailCustomTokenExchangeWithReservedNamespace() {
2383-
val callback = MockAuthenticationCallback<Credentials>()
2384-
client.customTokenExchange("https://auth0.com", "subject-token")
2385-
.start(callback)
2386-
ShadowLooper.idleMainLooper()
2387-
2388-
assertThat(
2389-
callback.error.message,
2390-
Matchers.containsString("Invalid URI")
2391-
)
2392-
assertThat(callback.error.cause, Matchers.instanceOf(IllegalArgumentException::class.java))
2393-
assertThat(
2394-
callback.error.cause?.message,
2395-
Matchers.containsString("reserved namespace")
2396-
)
2397-
}
2398-
2399-
@Test
2400-
public fun shouldFailCustomTokenExchangeSyncWithReservedNamespace() {
2401-
val exception = assertThrows(AuthenticationException::class.java) {
2402-
client.customTokenExchange("urn:okta", "subject-token")
2403-
.execute()
2404-
}
2405-
2406-
assertThat(exception.message, Matchers.containsString("Invalid URI"))
2407-
assertThat(exception.cause, Matchers.instanceOf(IllegalArgumentException::class.java))
2408-
assertThat(
2409-
exception.cause?.message,
2410-
Matchers.containsString("reserved namespace")
2411-
)
2412-
}
2413-
2414-
@Test
2415-
@ExperimentalCoroutinesApi
2416-
public fun shouldFailCustomTokenExchangeAwaitWithReservedNamespace() {
2417-
val exception = assertThrows(AuthenticationException::class.java) {
2418-
runTest {
2419-
client.customTokenExchange("urn:auth0", "subject-token")
2420-
.await()
2421-
}
2422-
}
2423-
2424-
assertThat(exception.message, Matchers.containsString("Invalid URI"))
2425-
assertThat(exception.cause, Matchers.instanceOf(IllegalArgumentException::class.java))
2426-
assertThat(
2427-
exception.cause?.message,
2428-
Matchers.containsString("reserved namespace")
2429-
)
2430-
}
2431-
2432-
@Test
2433-
public fun shouldFailCustomTokenExchangeWithInvalidHttpUri() {
2434-
val callback = MockAuthenticationCallback<Credentials>()
2435-
client.customTokenExchange("http://invalid uri with spaces", "subject-token")
2436-
.start(callback)
2437-
ShadowLooper.idleMainLooper()
2438-
2439-
assertThat(callback, AuthenticationCallbackMatcher.hasError(Credentials::class.java))
2440-
assertThat(
2441-
callback.error.message,
2442-
Matchers.containsString("Invalid URI")
2443-
)
2444-
assertThat(
2445-
callback.error.cause?.message,
2446-
Matchers.containsString("not a valid URI")
2447-
)
2448-
}
2449-
2450-
@Test
2451-
public fun shouldFailCustomTokenExchangeWithMalformedHttpsUri() {
2452-
val callback = MockAuthenticationCallback<Credentials>()
2453-
client.customTokenExchange("https://[invalid:uri:format", "subject-token")
2454-
.start(callback)
2455-
ShadowLooper.idleMainLooper()
2456-
2457-
assertThat(
2458-
callback.error.message,
2459-
Matchers.containsString("Invalid URI")
2460-
)
2461-
assertThat(
2462-
callback.error.cause?.message,
2463-
Matchers.containsString("not a valid URI")
2464-
)
2465-
}
2466-
24672381
@Test
24682382
public fun shouldSsoExchange() {
24692383
mockAPI.willReturnSuccessfulLogin()

0 commit comments

Comments
 (0)