Questions tagged [azure-ad-graph-api]

Use this tag for Azure AD Graph API (see link [1] in details below) related questions (not Microsoft Graph). The Azure Active Directory Graph API provides programmatic access to Azure AD through REST API endpoints. Applications can use the Graph API to perform create, read, update, and delete (CRUD) operations on directory data and objects

Graph API supports the following common operations for a user object:

  • Create a new user in a directory
  • Get a user’s detailed properties, such as their groups
  • Update a user’s properties, such as their location and phone number, or change their password
  • Check a user’s group membership for role-based access
  • Disable a user’s account or delete it entirely

In addition to user objects, you can perform similar operations on other objects such as groups and applications.

Useful Links:

  1. Documentation
  2. MSDN: Azure AD Graph API Reference
  3. Microsoft Graph or Azure AD Graph
1920 questions
11
votes
3 answers

Get refresh token with Azure AD V2.0 (MSAL) and Asp .Net Core 2.0

I've got access_token from Azure Ad V2.0 endpoint to call Graph Api. But I have to do some actions in the api on behalf of user. So I need refresh_token to renew my access_token when it'll expire. Is there any way to get Refresh token using MSAL in…
11
votes
6 answers

Microsoft Azure AD graph API: How do I retrieve a user's email address?

I am able to get access to a user's accessToken, and am making a call to GET https://graph.microsoft.com/v1.0/me with an Authorization: Bearer header. However, in the response body I'm getting something like this: { "@odata.context":…
11
votes
1 answer

Microsoft graph API access tokens lifetime

I'm having some trouble understanding how to get a Microsoft graph API token that lives more than 3599 seconds. This is my first call to the API to get the first token: And now that I got a refresh token I going to pass it through another call to…
11
votes
3 answers

How to access Graph API from Web API in SPA application

I have an Angular application that talks to the WebAPI and the users are authenticated against Azure Active Directory I followed the sample here https://github.com/Azure-Samples/active-directory-angularjs-singlepageapp-dotnet-webapi and was able to…
10
votes
4 answers

How to access Email of an User on B2C using Graph API

I want to know the email address of a user to send an email. On my application, people can sign up with social accounts (google/facebook/Microsoft) or local accounts. When creating a local account we use the email. I found this info about how email…
10
votes
2 answers

How to get Azure tenant name from graph.microsoft.com?

I need to discover user's tenant name, since the service endpoint, resourceId that I'll be using an Azure service that requires me to specify the tenant name: service endpoint: https://[tenantnamme].api.crm.dynamics.com/... resource Id: …
9
votes
2 answers

How to call azure graph api using postman

I am trying to call graph api to get user information. I am using postman to get the token first and then using that token trying to make a request to graph api I get the token with below post request and with 4 key values for grant_type, client_id,…
user1298426
  • 3,467
  • 15
  • 50
  • 96
9
votes
2 answers

In Azure AD B2C, How do i link a social account of a user with an already existing local account during first time sign in from social login?

As i understand from documentation, Azure AD B2C creates a new local account for every user that comes from a social login such as GMail/Facebook while signin first time (Correct me, if i'm wrong). However i want to intercept this and link the user…
9
votes
2 answers

Create a new user in Azure Active Directory (B2C) with Graph API, using http post request

I have previously been adding users programmatically using Active Directory Authentication Library (ADAL), but now I need to define "signInNames" (= users email), and that doesn't seem to be possible with ADAL (please tell me if im wrong). Now I'm…
mellberg
  • 181
  • 1
  • 1
  • 5
9
votes
1 answer

Adding Applications programmatically in Azure AD using Client Credentials Flow

For use with the Azure API Management, I am trying to add Applications to an Azure Active Directory (AAD) programmatically, in my case by using the Graph API. My scenario is the following: In order to secure a Web API I want to manage with Azure API…
donmartin
  • 1,753
  • 2
  • 15
  • 30
8
votes
2 answers

What is difference between "Rest" API and "Graph" API

I am creating an API project in Azure AD B2C in which I want to create a custom UI. For this requirement, I want to know which is better in both "Rest" API & "Graph" API. Can anyone suggest to me, which is better to use?
Mani
  • 1,228
  • 3
  • 10
  • 28
8
votes
0 answers

asp net core 2 and Azure AD B2C, adding group based authorization

I'm creating an asp net core 2 web api using azure AD B2C for authentification. I would like to use AD B2C groups to restrict the use of some controllers to admin members. I've understood that for the moment the only way to achieve that is to access…
8
votes
1 answer

How do I check to see if my AzureAD version is V1 or V2?

Where would I look to check the AzureAD version? Is there some command line utility that would return the version, or some rest endpoint that gives basic information like that?
John Rood
  • 805
  • 3
  • 13
  • 25
8
votes
2 answers

Change Azure AD B2C User Password with Graph API

I'm trying to use the Sample Graph API app to change a user's password but I'm getting: Error Calling the Graph API Response: { "odata.error": { "code": "Authorization_RequestDenied", "message": { "lang": "en", "value":…
spottedmahn
  • 14,823
  • 13
  • 108
  • 178
8
votes
4 answers

Find a User by Email Address

I'm trying find out if an email address is already taken in my Azure AD B2C directory. var token = await this.GetTokenAsync(); var client = new HttpClient(); var id =…
Adrian Thompson Phillips
  • 6,893
  • 6
  • 38
  • 69