title: SCIM endpoint and user provisioning with Azure Active Directory & Symfony
body: <p>i'm developing a <strong>SCIM endpoint</strong> API to enable automatic provisioning of users between my <strong>symfony v5</strong> application and <strong>Azure AD</strong>.
  Actually i did not find enough documentation to help me develop this, also i am not an expert but i followed docs.microsoft for some guidelines.
  i start by building a symfony REST API CRUD without using any bundle,all my endpoints start by /Users.</p>
  <p>Then i hosted my application on a remote site (PLESK) with this url : <a href="https://example.com/" rel="nofollow noreferrer">https://example.com/</a>
  and now i want to Integrate my SCIM endpoint with the Azure AD SCIM client. In the <strong>Tenant URL</strong> field i put this URL: <a href="https://example.com/scim" rel="nofollow noreferrer">https://example.com/scim</a>
  but i receive this error, can anyone please explain me if i am doing the right thing ? and why i receive this error?</p>
  <blockquote>
  <p>You appear to have entered invalid credentials. Please confirm you are
  using the correct information for an administrative account. Error
  code:
  SystemForCrossDomainIdentityManagementCredentialValidationUnavailable
  Details: We received this unexpected response from your application:
  An HTTP/404 Not Found response was returned rather than the expected
  HTTP/200 OK response. To address this issue, ensure that the tenant
  URL is correct. The tenant URL is usually in a format like:
  https://&lt;&gt;/scim. If this does not resolve the issue, contact the
  application developer to ensure their SCIM endpoint conforms with the
  protocol <a href="https://www.rfc-editor.org/rfc/rfc7644#section-3.4.2" rel="nofollow noreferrer">https://www.rfc-editor.org/rfc/rfc7644#section-3.4.2</a></p>
  </blockquote>
  <p>this is my API Controller Class example create user  :</p>
  <pre><code>class APIController extends AbstractController
  {
  
  //Create User
      /**
       * @Route(&quot;/Users&quot;, name=&quot;ajout&quot;, methods={&quot;POST&quot;})
       */
      public  function addUser(Request $request){
          //On verifie si on a une requette
  // On vérifie si la requête est une requête Ajax
          //if($request-&gt;isXmlHttpRequest()) {
          // On instancie un nouvel article
          $user = new User();
  
          // On décode les données envoyées
          $donnees = json_decode($request-&gt;getContent());
  
          // On hydrate l'objet
          $user-&gt;setEmail($donnees-&gt;email);
          $user-&gt;setRoles($donnees-&gt;roles);
  
          // On sauvegarde en base
          $entityManager = $this-&gt;getDoctrine()-&gt;getManager();
          $entityManager-&gt;persist($user);
          $entityManager-&gt;flush();
  
          // On retourne la confirmation
          return new Response('ok', 201);
      }
      //return new Response('Failed', 404); }
  } 
  </code></pre>