回答

1
 Authentication authentication = SecurityContextHolder.getContext() 
       .getAuthentication(); 
     SAMLCredential credential = (SAMLCredential) authentication 
       .getCredentials(); 

     for(Attribute attribute: credential.getAttributes()){ 
      List<XMLObject> values= attribute.getAttributeValues(); 
      for(XMLObject value: values){ 
       System.out.println(value.getDOM().getTextContent()); 

      } 
     }