Skip to content

Commit c3be416

Browse files
committed
Minor changes as per the feedback
1 parent e990a6d commit c3be416

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import java.net.URI
1010
*/
1111
public class CustomTokenExchangeValidator : RequestValidator {
1212

13-
private val reservedNameSpace = listOf(
13+
private val reservedNamespaces = listOf(
1414
"http://auth0.com",
1515
"https://auth0.com",
1616
"http://okta.com",
@@ -23,8 +23,16 @@ public class CustomTokenExchangeValidator : RequestValidator {
2323
override fun validate(options: RequestOptions) {
2424
val subjectTokenType = options.parameters["subject_token_type"] as String
2525

26+
if(subjectTokenType.isEmpty()){
27+
throw AuthenticationException(
28+
"Invalid URI", IllegalArgumentException(
29+
"The passed URI must not be an empty String"
30+
)
31+
)
32+
}
33+
2634
// Check if it's a reserved namespace
27-
if (reservedNameSpace.contains(subjectTokenType)) {
35+
if (reservedNamespaces.contains(subjectTokenType)) {
2836
throw AuthenticationException(
2937
"Invalid URI", IllegalArgumentException(
3038
"The passed URI is a reserved namespace and cannot be used"

0 commit comments

Comments
 (0)