title: How to create users using Microsoft Graph API (from Graph explorer and Java application)
body: <p>I am new to Microsoft Graph API. I have read many articles on the web to understand  the usage of Microosft Garph API for managing users in Azure AD. I am creating a Springboot based REST API service, which needs to create users in Azure AD. </p>
  
  <p>I have registered my application in Azure Active Directory. I have also 'Directory.ReadWrite.All" permission for Microsoft Graph API. I wanted to first try to create the user from Microsoft Garph explorer. In the Graph Explorer, I have to give authorization token in the Request header. In order to create authorization token, I have followed the instruction given in the link <a href="https://docs.microsoft.com/en-us/graph/auth-v2-user" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/graph/auth-v2-user</a>. I have created the following URL based on the instruction, for obtaining Access token.</p>
  
  <pre><code>https://login.microsoftonline.com/{mytenantID}/oauth2/v2.0/authorize?client_id=validclientID&amp;response_type=code&amp;redirect_uri=https://localhost:4200&amp;response_mode=query&amp;scope=Directory.ReadWrite.All&amp;state=12345
  </code></pre>
  
  <p>When the above URL is accessed from the web browser, I get a message which says "Need Admin Approval". I am not the admin of the Azure AD and I do not have access to the admin of my client, so I am really stuck. Can anybody help me understand whether I will have to get admin consent each time I need to access "create user" functionality of Azure AD through MS Graph API? . I would also also need the create user functionaltiy in the Springboot API. In this case, how would Admin Consent work?. Is there anyway that the create user functionality can work without Admin consent.</p>
  
  <p>I have read the following two questions in SO before posting this question</p>
  
  <p><a href="https://stackoverflow.com/questions/53309253/how-can-i-find-the-admin-consent-url-for-an-azure-ad-app-that-requires-microsoft">How can I find the Admin Consent URL for an Azure AD App that requires Microsoft Graph &quot;Read directory data&quot; permission?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/52091590/create-user-using-microsoft-graph">Create user using Microsoft Graph</a></p>