title: How to fetch SAML Assertion from ADFS for AWS STS in Java
body: <p>I need to fetch temporary credentials from AWS STS.
  Using below AWS SDK api:</p>
  
  <pre><code>AssumeRoleWithSAMLRequest samlreq =new AssumeRoleWithSAMLRequest().withPrincipalArn(principalARN).withRoleArn(roleARN).withSAMLAssertion(SAMLToken);
  </code></pre>
  
  <p>Above API call needs SAML assertion/token from SAML 2.0 compliant ADFS.<br>
  My application is in Java. Need sample Java code to retrieve SAML Assertion/Token from ADFS IDP and use it in AWS SDK  </p>
  
  <p>Note: I am able to do SAML based federated user SSO to login to AWS console with ADFS and AWS account setup that I am using, just need to do it programmatically.  </p>