title: Trying to write a java code to authenticate Graph API
body: <p>I'm trying to write a java code to authenticate the graph API by the Azure Access Control Service (ACS) using OAuth 2.0. </p>
  
  <p>Based on what I've read, They are four steps to this</p>
  
  <ol>
  <li>Generate an assertion which includes the Service Principal’s X.509 Certificate (alternatively, a symmetric key can also be used).</li>
  <li>Present the assertion to the Azure ACS Security Token Service (STS).</li>
  <li>ACS accepts the assertion and authenticates the Service Principal, returning a minted OAuth access token (i.e. JWT token).</li>
  <li>Subsequent API call submissions include the access token.</li>
  </ol>
  
  <p>Can anyone tell me, where do I begin this from? For example, where can I find the java api, how do I generate a symmetric key or an assertion with X.509 cert. I want to create an java app which will create users in the office 365 and authenticating is the initial step. Thanks for the help</p>