title: SAML token based authentication for consuming share point 2013 rest web services from JAVA/J2ee application
body: <p>I have a java/j2ee web application consuming SP web services but recently the SP site got migrated to 2013 and deployed in cloud/office 0365 due to which authentication got broken. SP people suggested to change authentication mechanism to SAML token based authentication and use Microsoft Azure AD. So i on boarded my application into Azure and received Client ID, Authority using which i am able to generate security token(used adal4j java api) . Now i need to complete below 2  steps to complete the authentication process in office 0365 to access SP 2013 web services.</p>
  
  <ol>
  <li>Get access token cookies </li>
  <li>Get request digest token </li>
  </ol>
  
  <p>But not able to find any java based API for above 2 steps. Refereed below tutorial buts its something related to aps/.net</p>
  
  <p><a href="http://paulryan.com.au/2014/spo-remote-authentication-rest/" rel="nofollow">http://paulryan.com.au/2014/spo-remote-authentication-rest/</a></p>
  
  <p>Please help me in providing sample code base for the same.</p>
  
  <p>Appreciate your support</p>