This sample demonstrates the following:
- Create1 a V2 App (which can be used in B2C) using Microsoft Graph Apis
- Create2 a V2 App (which can be used in B2C) using Microsoft Graph and AADGraph Apis.
- List all v2 apps in the tenant using MSGraph Beta apis
- An global administrator account is required to run admin-level operations and to consent to application permissions. (for example: admin@myb2ctenant.onmicrosoft.com)
- Sign in to the Application Registration Portal using your Microsoft account.
- Select Add an app, and enter a friendly name for the application (such as Console App for Microsoft Graph (Delegated perms)). Click Create.
- On the application registration page, select Add Platform. Select the Native App tile and save your change. The delegated permissions operations in this sample use permissions that are specified in the AuthenticationHelper.cs file. This is why you don't need to assign any permissions to the app on this page.
- Open the solution and then the Constants.cs file in Visual Studio.
- Make the Application Id value for this app the value of the ClientIdForUserAuthn string.
- Update Tenant with the name of your tenant. (for example: myb2ctenantname.onmicrosoft.com)
- Open the sample solution in Visual Studio.
- Build the sample.
- Using cmd or PowerShell, navigate to /bin/Debug. Run the executable B2CAppGraph.exe.
- Sign in as a global administrator. (for example: admin@myb2ctenant.onmicrosoft.com)
- The output will show the results of calling the Graph API .