title: SAML authentication in Azure AD via Java struts web application
body: <p>In one of the java struts based web projects, I have implemented SSO (Single-sign-on) using SAML authentication, using picketlink library, deployed on Jboss AS 7.1. Its working without any issues.</p>
  
  <p>I need to implement the SSO in another Struts based web project, running on Tomcat 7. The IDP in this case is Azure AD. I have followed the steps given in the article <a href="https://dzone.com/articles/saml-single-sign-on-with-tomcat-and-picketlink" rel="nofollow noreferrer">SAML with Tomcat and PicketLink</a>. I have also configured the application in Azure AD. The IDP and SP URLs are mentioned in the picketlink conif file as follows:</p>
  
  <pre><code>&lt;PicketLink xmlns="urn:picketlink:identity-federation:config:2.1"&gt;
  &lt;PicketLinkSP xmlns="urn:picketlink:identity-federation:config:2.1" BindingType="POST"&gt;
      &lt;IdentityURL&gt;${idp.url::https://login.microsoftonline.com/29b0-4f33-a90e/saml2}&lt;/IdentityURL&gt;
      &lt;ServiceURL&gt;${myapp.url::https://appserver.mydomain.com:10503/myapp/internal/}&lt;/ServiceURL&gt;
      &lt;Trust&gt;
          &lt;Domains&gt;localhost,mydomain.com&lt;/Domains&gt;
      &lt;/Trust&gt;
  &lt;/PicketLinkSP&gt;
  &lt;Handlers xmlns="urn:picketlink:identity-federation:handler:config:2.1"&gt;
      &lt;Handler class="org.picketlink.identity.federation.web.handlers.saml2.SAML2IssuerTrustHandler" /&gt;
      &lt;Handler class="org.picketlink.identity.federation.web.handlers.saml2.SAML2LogOutHandler" /&gt;
      &lt;Handler class="org.picketlink.identity.federation.web.handlers.saml2.SAML2AuthenticationHandler"&gt;
          &lt;Option Key="ROLE_KEY" Value="http://schemas.microsoft.com/ws/2008/06/identity/claims/role"/&gt;
      &lt;/Handler&gt;
      &lt;Handler class="org.picketlink.identity.federation.web.handlers.saml2.RolesGenerationHandler" /&gt;
  &lt;/Handlers&gt;
  </code></pre>
  
  <p></p>
  
  <p>I have mentioned the SAML-P endpoint that I got from Azure AD against the configured application in the above file.</p>
  
  <blockquote>
    <p>${idp.url::<a href="https://login.microsoftonline.com/29b0-4f33-a90e/saml2" rel="nofollow noreferrer">https://login.microsoftonline.com/29b0-4f33-a90e/saml2</a>}</p>
  </blockquote>
  
  <p>Its not working after making all these changes. It looks like I need to get the certificate from the federation-metadata file and follow some steps to enable SSL and to make it ready for SAML to understand. I could not do this.
  I do not know if my path is correct. Can you please give me a sample program or steps to complete this task.</p>