Skip to content

Commit 8e52f99

Browse files
committed
validate that xml response is loaded and current url is set
1 parent b504a70 commit 8e52f99

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/main/java/com/onelogin/saml/Response.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,15 @@ public void loadXmlFromBase64(String responseStr) throws Exception {
8484
public boolean isValid(String... requestId){
8585
try{
8686
Calendar now = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
87-
87+
88+
if(this.document == null){
89+
throw new Exception("SAML Response is not loaded");
90+
}
91+
92+
if(this.currentUrl == null || this.currentUrl.isEmpty()){
93+
throw new Exception("The URL of the current host was not established");
94+
}
95+
8896
rootElement = document.getDocumentElement();
8997
rootElement.normalize();
9098

0 commit comments

Comments
 (0)