Question: I have a graph with following structure:

* @rid
* @class
* @version
* *content* (json content)

The column `_content_` stores a json like `{"phoneNumber":"+5511999998888","date":"2017-05-09T18:23:31Z"}`.

I would like to perform a search by `date` attribute where the value is lower than another value.

Is possible to run a query like that with the folowing structure? How can I write the select condition? I'm kinda new to OrientDB.

Answer: 
If the two web APIs are separate applications in Azure AD, then you need to request access tokens separately for them. 

I'm not familiar with the sample you used as a starting point, but it looks like these lines are where you need to make your change:

```cs
// Retrieve the token using the provided scopes
ConfidentialClientApplication app = new ConfidentialClientApplication(authority, Startup.ClientId,
                                    Startup.RedirectUri, credential,
                                    new NaiveSessionCache(userObjectID, this.HttpContext));
AuthenticationResult result = await app.AcquireTokenSilentAsync(scope);

accessToken = result.Token;

```

You should create an `app` instance for each of your APIs, and acquire a token for each of them. Then, when you call the APIs somewhere else, use the correct access token in the Bearer authentication header.
I had the same issue and asked a similar question [Extend MSAL to support multiple Web APIs](https://stackoverflow.com/questions/43869332/extend-msal-to-support-multiple-web-apis)

but i have not had an answer, basically to get around it in the short term i have made both my API's use the same authorization client ID + secret and therefore I can reuse the same scopes accross my APIS

its not what i want but if you want to use Azure AD B2C you need to get used to compromising for a while until the support is there 

-- I would also say you are using an older version of MSAL which i am also using, im waiting until the version 1 release before upgrading again. 

The github talks about using this format 

<https://github.com/AzureAD/microsoft-authentication-library-for-dotnet>

```
Step 1: Add MSAL to your Solution/Project
Right click on your project > Manage packages.
Select include prerelease > search msal.
Select the Microsoft.Identity.Client package > install.

Step 2: Instantiate MSAL and Acquire a Token
Create a new PublicClientApplication instance. Make sure to fill in your 
app/client id
PublicClientApplication myApp = new PublicClientApplication(CLIENT_ID);
Acquire a token
AuthenticationResult authenticationResult = await 
myApp.AcquireTokenAsync(SCOPES).ConfigureAwait(false);

Step 3: Use the token!
The access token can now be used in an HTTP Bearer request.

```