Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create new test module: azure-spring-boot-test-aad-resource-server #18412

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6b5ba65
1. Add new test module: azure-spring-boot-test-aad-resource-server.
rujche Dec 31, 2020
ce9e0be
Update the required dependency about oauth2-client and oauth2-resourc…
rujche Dec 31, 2020
ef72cd1
Delete duplicated codes in aad integration test modules.
rujche Dec 31, 2020
103ae2e
Merge branch 'master' into create-new-test-module-azure-spring-boot-t…
rujche Jan 4, 2021
fc01b83
Update azure-spring-boot-starter-active-directory's version to 3.0.0.
rujche Jan 4, 2021
9fdfa9d
Move aad test utils to azure-spring-boot-test-core.
rujche Jan 4, 2021
8b21823
Move AADOauth2ROPCGrantClientIT to azure-spring-boot-test-core.
rujche Jan 4, 2021
f8052e2
Delete unused java class: OAuthResponse.
rujche Jan 4, 2021
03bc2a1
Change package name in azure-spring-boot-test-core.
rujche Jan 4, 2021
f8911dc
Change dependency order to make it easier to read.
rujche Jan 4, 2021
728a4a4
Add "test" scope for test dependencies.
rujche Jan 4, 2021
5552e87
Move filter related test into a new module: azure-spring-boot-test-aa…
rujche Jan 4, 2021
05cf1a1
Rename azure-spring-boot-sample-active-directory-resource-server-with…
rujche Jan 4, 2021
f62f82f
Rename azure-spring-boot-sample-active-directory-resource-server-stat…
rujche Jan 4, 2021
ab7507f
No logic change, just sort lines.
rujche Jan 4, 2021
86e0b44
Add 2 new artifacts: azure-spring-boot-test-aad-resource-server and a…
rujche Jan 4, 2021
9256036
1. Move "HOW_TO_RUN_AAD_INTEGRATION_TEST_IN_LOCALHOST.md" to "sdk/spr…
rujche Jan 4, 2021
bc341c2
Test AADAuthenticationFilter by cookie.
rujche Jan 4, 2021
8b50570
Add azure-spring-boot-test-aad-resource-server-by-filter in version_c…
rujche Jan 4, 2021
3e66ff7
No logic change, just rename method.
rujche Jan 4, 2021
ac55d12
Merge branch 'master' into create-new-test-module-azure-spring-boot-t…
rujche Jan 5, 2021
6d13cba
Fix version error.
rujche Jan 5, 2021
b569480
Fix version error.
rujche Jan 5, 2021
8668378
Fix error in AADAuthenticationFilterIT.
rujche Jan 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ com.azure.spring:azure-spring-data-gremlin;2.3.1-beta.1;2.3.1-beta.1
com.azure.spring:azure-spring-boot-starter-data-gremlin;3.0.0-beta.1;3.0.0-beta.1
com.azure.spring:azure-spring-boot-test-aad;1.0.0;1.0.0
com.azure.spring:azure-spring-boot-test-aad-obo;1.0.0;1.0.0
com.azure.spring:azure-spring-boot-test-aad-resource-server;1.0.0;1.0.0
com.azure.spring:azure-spring-boot-test-aad-resource-server-by-filter;1.0.0;1.0.0
com.azure.spring:azure-spring-boot-test-core;1.0.0;1.0.0
com.azure.spring:azure-spring-boot-test-cosmosdb;1.0.0;1.0.0
com.azure.spring:azure-spring-boot-test-keyvault;1.0.0;1.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ Get `AAD_TENANT_ID_2`, `AAD_USER_NAME_2`, `AAD_USER_PASSWORD_2` with the same me

4. Add API permissions. Grant admin consent.
![add-api-permission](images/add-api-permission.png)

5. Expose API: `ResourceAccessGraph.Read`, `TestScope1`, `TestScope2`.
![expose-api](images/expose-api.png)

5. Now we get value of `AAD_MULTI_TENANT_CLIENT_ID`, `AAD_MULTI_TENANT_CLIENT_SECRET`.
6. Now we get value of `AAD_MULTI_TENANT_CLIENT_ID`, `AAD_MULTI_TENANT_CLIENT_SECRET`.

### `AAD_SINGLE_TENANT_CLIENT_ID`, `AAD_SINGLE_TENANT_CLIENT_SECRET`
Get `AAD_SINGLE_TENANT_CLIENT_ID`, `AAD_SINGLE_TENANT_CLIENT_SECRET` with the same method.
Expand Down Expand Up @@ -102,10 +105,22 @@ $env:AAD_SINGLE_TENANT_CLIENT_SECRET_WITH_ROLE='xxxxxxxx'
```

## Run AAD integration test by maven.
Command:
azure-spring-boot-test-aad:
```
mvn -f .\sdk\spring\azure-spring-boot-test-aad\pom.xml --fail-at-end "-Dmaven.javadoc.skip=true" "-Drevapi.skip=true" "-DskipSpringITs=false" verify
```
azure-spring-boot-test-aad-obo:
```
mvn -f .\sdk\spring\azure-spring-boot-test-aad-obo\pom.xml --fail-at-end "-Dmaven.javadoc.skip=true" "-Drevapi.skip=true" "-DskipSpringITs=false" verify
```
azure-spring-boot-test-aad-resource-server:
```
mvn -f .\sdk\spring\azure-spring-boot-test-aad-resource-server\pom.xml --fail-at-end "-Dmaven.javadoc.skip=true" "-Drevapi.skip=true" "-DskipSpringITs=false" verify
```
azure-spring-boot-test-aad-resource-server-by-filter:
```
mvn -f .\sdk\spring\azure-spring-boot-test-aad-resource-server-by-filter\pom.xml --fail-at-end "-Dmaven.javadoc.skip=true" "-Drevapi.skip=true" "-DskipSpringITs=false" verify
```


[Create a new tenant in Azure Active Directory]: https://docs.microsoft.com/azure/active-directory/fundamentals/active-directory-access-create-new-tenant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ data: {

### Run with Maven
```shell
cd azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-stateless
cd azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-by-filter-stateless
mvn spring-boot:run
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>

<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-boot-sample-active-directory-resource-server-stateless</artifactId>
<artifactId>azure-spring-boot-sample-active-directory-resource-server-by-filter-stateless</artifactId>
<version>1.0.0</version>

<name>Azure Spring Boot Starter Sample - Azure AD Stateless Spring Security Integration</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ From your command line:
```command line
git clone https://github.com/Azure/azure-sdk-for-java.git
```
or download and extract the repository .zip file, and navigate to `azure-spring-boot-sample-active-directory-resource-server-with-filter` from the list of samples.
or download and extract the repository .zip file, and navigate to `azure-spring-boot-sample-active-directory-resource-server-by-filter` from the list of samples.

---
### Step 2: Register the sample with your Azure Active Directory tenant
Expand Down Expand Up @@ -140,7 +140,7 @@ msalProvider.init(

* Run with Maven
```
cd azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-with-filter
cd azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-by-filter
mvn spring-boot:run
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>

<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-boot-sample-active-directory-resource-server-with-filter</artifactId>
<artifactId>azure-spring-boot-sample-active-directory-resource-server-by-filter</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>

Expand Down
38 changes: 27 additions & 11 deletions sdk/spring/azure-spring-boot-starter-active-directory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ With Spring Starter for Azure Active Directory, now you can get started quickly
* **Create a client secret key for the application**: Go to API ACCESS - Keys to create a secret key (`client-secret`).

### Include the package
To use this starter in an web application, please add following packages:
To use this starter in a web application, please add following packages:

[//]: # "{x-version-update-start;com.azure.spring:azure-spring-boot-starter-active-directory;current}"
```xml
Expand All @@ -26,13 +26,13 @@ To use this starter in an web application, please add following packages:
<version>3.2.0-beta.1</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-oauth2-client</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-client</artifactId>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yiliuTo ,
(cc: @saragluna , @backwind1233 , FYI)

we should use xxx-starter instead of xxx, because xxx-starter can include other necessary dependencies. Like spring-security-oauth2-jose.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @wujack778.

</dependency>
```
[//]: # "{x-version-update-end}"

To use this starter in a resource server, please add following packages:
To use this starter in a resource server without OBO function, please add following packages:

[//]: # "{x-version-update-start;com.azure.spring:azure-spring-boot-starter-active-directory;current}"
```xml
Expand All @@ -42,12 +42,28 @@ To use this starter in a resource server, please add following packages:
<version>3.2.0-beta.1</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-oauth2-client</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
</dependency>
```
[//]: # "{x-version-update-end}"

To use this starter in a resource server with OBO function, please add following packages:
Copy link
Author

@chenrujun chenrujun Dec 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependency is different between resource-server and resource-server with obo function.


[//]: # "{x-version-update-start;com.azure.spring:azure-spring-boot-starter-active-directory;current}"
```xml
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-boot-starter-active-directory</artifactId>
<version>3.0.0-beta.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-oauth2-resource-server</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-client</artifactId>
chenrujun marked this conversation as resolved.
Show resolved Hide resolved
</dependency>
```
[//]: # "{x-version-update-end}"
Expand Down Expand Up @@ -299,7 +315,7 @@ azure:
```

### Authenticate in web APIs [Web APIs]
Please refer to [azure-spring-boot-sample-active-directory-resource-server-with-filter] for how to integrate Spring Security and Azure AD for authentication and authorization in a Single Page Application (SPA) scenario.
Please refer to [azure-spring-boot-sample-active-directory-resource-server-by-filter] for how to integrate Spring Security and Azure AD for authentication and authorization in a Single Page Application (SPA) scenario.

#### Configure application.yml:
```yaml
Expand Down Expand Up @@ -402,7 +418,7 @@ The following section provides sample projects illustrating how to use the start
- [Azure Active Directory for Web apps][azure-spring-boot-sample-active-directory-webapp]
- [Azure Active Directory for Web APIs][azure-spring-boot-sample-active-directory-resource-server]
- [Azure Active Directory for On-Behalf-Of flow][azure-spring-boot-sample-active-directory-resource-server-obo]
- [Azure Active Directory for Resource Server with Filter(Deprecated)][azure-spring-boot-sample-active-directory-resource-server-with-filter]
- [Azure Active Directory for Resource Server by Filter(Deprecated)][azure-spring-boot-sample-active-directory-resource-server-by-filter]

## Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
Expand All @@ -414,7 +430,7 @@ Please follow [instructions here] to build from source or contribute.
[azure-spring-boot-sample-active-directory-webapp]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-webapp
[azure-spring-boot-sample-active-directory-resource-server]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server/README.md
[azure-spring-boot-sample-active-directory-resource-server-obo]: https://github.com/ZhuXiaoBing-cn/azure-sdk-for-java/tree/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-obo
[azure-spring-boot-sample-active-directory-resource-server-with-filter]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-with-filter
[azure-spring-boot-sample-active-directory-resource-server-by-filter]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-by-filter
[AAD App Roles feature]: https://docs.microsoft.com/azure/architecture/multitenant-identity/app-roles#roles-using-azure-ad-app-roles
[client credentials grant flow]: https://docs.microsoft.com/azure/active-directory/develop/v1-oauth2-client-creds-grant-flow
[configured in your manifest]: https://docs.microsoft.com/azure/active-directory/develop/howto-add-app-roles-in-azure-ad-apps#examples
Expand Down
4 changes: 2 additions & 2 deletions sdk/spring/azure-spring-boot-starter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This starter brings auto configuration code for all Azure Spring modules, but to
## Examples
The following section provides sample projects illustrating how to use the Azure Spring Boot starters.
### More sample code
- [Azure Active Directory for Resource Server with Filter(Deprecated)](https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-with-filter)
- [Azure Active Directory for Resource Server by Filter(Deprecated)](https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-by-filter)
- [Azure Active Directory for Web Application](https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-webapp)
- [Azure Active Directory B2C](https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc)
- [Cosmos DB SQL API](https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-cosmos)
Expand Down Expand Up @@ -57,7 +57,7 @@ For more information about setting logging in spring, please refer to the [offic
## Next steps
The following section provides sample projects illustrating how to use the Azure Spring Boot starters.
### More sample code
- [Azure Active Directory for Resource Server with Filter(Deprecated)](https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-with-filter)
- [Azure Active Directory for Resource Server by Filter(Deprecated)](https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-by-filter)
- [Azure Active Directory for Web Application](https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-webapp)
- [Azure Active Directory B2C](https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc)
- [Cosmos DB SQL API](https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-cosmos)
Expand Down
25 changes: 15 additions & 10 deletions sdk/spring/azure-spring-boot-test-aad-obo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,37 @@
<version>1.0.0</version> <!-- {x-version-update;com.azure.spring:azure-spring-boot-test-aad-obo;current} -->

<dependencies>
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-boot-test-core</artifactId>
<version>1.0.0</version> <!-- {x-version-update;com.azure.spring:azure-spring-boot-test-core;current} -->
</dependency>
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-boot-starter-active-directory</artifactId>
<version>3.2.0-beta.1</version> <!-- {x-version-update;com.azure.spring:azure-spring-boot-starter-active-directory;current} -->
</dependency>

<!-- spring boot starter dependencies. -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-oauth2-resource-server</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<!-- test dependencies. -->
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-boot-test-core</artifactId>
<version>1.0.0</version> <!-- {x-version-update;com.azure.spring:azure-spring-boot-test-core;current} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-client</artifactId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,15 @@

package com.azure.test.aad.webapi;

import com.azure.test.oauth.OAuthResponse;
import com.azure.test.oauth.OAuthUtils;
import com.azure.test.utils.AppRunner;
import com.azure.spring.test.aad.AADWebApiITHelper;
import com.azure.spring.test.AppRunner;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
Expand All @@ -34,56 +29,49 @@
import org.springframework.security.oauth2.client.web.reactive.function.client.ServletOAuth2AuthorizedClientExchangeFilterFunction;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.reactive.function.client.WebClient;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;

import static com.azure.test.oauth.OAuthUtils.AAD_MULTI_TENANT_CLIENT_ID;
import static com.azure.test.oauth.OAuthUtils.AAD_MULTI_TENANT_CLIENT_SECRET;
import static com.azure.spring.test.aad.EnvironmentVariables.AAD_MULTI_TENANT_CLIENT_ID;
import static com.azure.spring.test.aad.EnvironmentVariables.AAD_MULTI_TENANT_CLIENT_SECRET;
import static com.azure.spring.test.aad.EnvironmentVariables.MULTI_TENANT_SCOPE_GRAPH_READ;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.springframework.security.oauth2.client.web.reactive.function.client.ServletOAuth2AuthorizedClientExchangeFilterFunction.oauth2AuthorizedClient;

public class AADWebApiOboIT {

private static final Logger LOGGER = LoggerFactory.getLogger(AADWebApiOboIT.class);

private static final String GRAPH_ME_ENDPOINT = "https://graph.microsoft.com/v1.0/me";

private final RestTemplate restTemplate = new RestTemplate();
private AADWebApiITHelper aadWebApiITHelper;

@Before
public void init() {
Map<String, String> properties = new HashMap<>();
properties.put("azure.activedirectory.client-id", AAD_MULTI_TENANT_CLIENT_ID);
properties.put("azure.activedirectory.client-secret", AAD_MULTI_TENANT_CLIENT_SECRET);
properties.put("azure.activedirectory.app-id-uri", "api://" + AAD_MULTI_TENANT_CLIENT_ID);
properties.put("azure.activedirectory.authorization-clients.graph.scopes",
"https://graph.microsoft.com/User.Read");
aadWebApiITHelper = new AADWebApiITHelper(
DumbApp.class,
properties,
AAD_MULTI_TENANT_CLIENT_ID,
AAD_MULTI_TENANT_CLIENT_SECRET,
Collections.singletonList(MULTI_TENANT_SCOPE_GRAPH_READ));
}

@Test
public void testCallGraph() {
this.runApp(app -> {
final OAuthResponse authResponse = OAuthUtils.executeOAuth2ROPCFlow(
System.getenv(AAD_MULTI_TENANT_CLIENT_ID), System.getenv(AAD_MULTI_TENANT_CLIENT_SECRET));
assertNotNull(authResponse);

final HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", String.format("Bearer %s", authResponse.getAccessToken()));
HttpEntity<Object> entity = new HttpEntity<>(headers);
final ResponseEntity<String> response = restTemplate.exchange(
app.root() + "/call-graph",
HttpMethod.GET,
entity,
String.class,
new HashMap<>()
);
assertEquals(HttpStatus.OK, response.getStatusCode());
assertEquals("Graph response success.", response.getBody());
});
assertEquals("Graph response success.", aadWebApiITHelper.httpGetStringByAccessToken("call-graph"));
}

private void runApp(Consumer<AppRunner> command) {
try (AppRunner app = new AppRunner(AADWebApiOboIT.DumbApp.class)) {
final String clientId = System.getenv(AAD_MULTI_TENANT_CLIENT_ID);
final String clientSecret = System.getenv(AAD_MULTI_TENANT_CLIENT_SECRET);
app.property("azure.activedirectory.client-id", clientId);
app.property("azure.activedirectory.client-secret", clientSecret);
app.property("azure.activedirectory.app-id-uri", "api://" + clientId);
app.property("azure.activedirectory.authorization-clients.graph.scopes", "https://graph.microsoft.com/User.Read");
app.start();
command.accept(app);
}
Expand Down
Loading