title: Getting immutableid of an office365/azure user for the SAML assertion
body: <p>Looking at their documentation (<a href="https://docs.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-fed-saml-idp" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-fed-saml-idp</a>), it looks like we need three things in the SAML assertion. </p>
  
  <pre><code>NameID -    The value of this assertion must be the same as the Azure AD user’s ImmutableID
  
  IDPEmail -  The User Principal Name (UPN) is listed in the SAML response as an element with the name IDPEmail
  
  Issuer -    Required to be a URI of the identity provider
  </code></pre>
  
  <p>I assume idp email is just the email of the user which corresponds to <code>userPrincipalName</code> field in microsoft graph API. This we can easily fetch from the API. </p>
  
  <p>I am not sure however what ImmutableID is. </p>
  
  <p>Is there a way to fetch it using the microsoft's graph API? If not, how do we get it? </p>