File tree Expand file tree Collapse file tree
src/main/java/com/onelogin/saml Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ public void loadXmlFromBase64(String responseStr) throws Exception {
7676 this .response = new String (decodedB );
7777 this .document = Utils .loadXML (this .response );
7878 if (this .document == null ){
79- throw new Exception ("SAML Response could not be processed" );
79+ throw new Exception ("SAML Response could not be processed, invalid or empty SAML " );
8080 }
8181 }
8282
@@ -253,8 +253,10 @@ public String getNameId() throws Exception {
253253
254254 public String getAttribute (String name ) {
255255 HashMap <String , ArrayList <String >> attributes = getAttributes ();
256+
256257 if (!attributes .isEmpty ()) {
257- return attributes .get (name ).toString ();
258+ ArrayList <String > attrVal = attributes .get (name );
259+ return attrVal == null || attrVal .size () == 0 ? null : attrVal .get (0 ).toString ();
258260 }
259261 return null ;
260262 }
You can’t perform that action at this time.
0 commit comments