Skip to content

Commit 06ff734

Browse files
authored
Merge pull request #496 from mattmazzola/authority-path-error
Improve error message when Authority does not contain path
2 parents a9437d8 + 92cc182 commit 06ff734

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/main/java/com/microsoft/aad/msal4j/Authority.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static void validateAuthority(URL authorityUrl) {
117117

118118
if (segments.length == 0) {
119119
throw new IllegalArgumentException(
120-
IllegalArgumentExceptionMessages.AUTHORITY_URI_EMPTY_PATH_SEGMENT);
120+
IllegalArgumentExceptionMessages.AUTHORITY_URI_MISSING_PATH_SEGMENT);
121121
}
122122

123123
for (String segment : segments) {

src/main/java/com/microsoft/aad/msal4j/IllegalArgumentExceptionMessages.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ class IllegalArgumentExceptionMessages {
77

88
final static String AUTHORITY_URI_EMPTY_PATH_SEGMENT = "Authority Uri should not have empty path segments";
99

10+
final static String AUTHORITY_URI_MISSING_PATH_SEGMENT = "Authority Uri must have at least one path segment. This is usually 'common' or the application's tenant id.";
11+
1012
final static String AUTHORITY_URI_EMPTY_PATH = "Authority Uri should have at least one segment in the path";
1113

1214
}

0 commit comments

Comments
 (0)