Skip to content

Commit 11af211

Browse files
author
Rujun Chen
authored
Create new test module: azure-spring-boot-test-aad-resource-server (Azure#18412)
1. Add new test module: azure-spring-boot-test-aad-resource-server. 2. Update HOW_TO_RUN_AAD_INTEGRATION_TEST_IN_LOCALHOST.md. 3. Update the required dependency about oauth2-client and oauth2-resource-server. 4 .Delete duplicated codes in aad integration test modules. 5. Rename azure-spring-boot-sample-active-directory-resource-server-with-filter to azure-spring-boot-sample-active-directory-resource-server-by-filter. 6. Rename azure-spring-boot-sample-active-directory-resource-server-stateless to azure-spring-boot-sample-active-directory-resource-server-by-filter-stateless. 7. Move filter related test into a new module: azure-spring-boot-test-aad-resource-server-by-filter
1 parent dc8f3e1 commit 11af211

File tree

82 files changed

+979
-751
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+979
-751
lines changed

eng/versioning/version_client.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ com.azure.spring:azure-spring-data-gremlin;2.3.1-beta.1;2.3.1-beta.1
142142
com.azure.spring:azure-spring-boot-starter-data-gremlin;3.0.0-beta.1;3.0.0-beta.1
143143
com.azure.spring:azure-spring-boot-test-aad;1.0.0;1.0.0
144144
com.azure.spring:azure-spring-boot-test-aad-obo;1.0.0;1.0.0
145+
com.azure.spring:azure-spring-boot-test-aad-resource-server;1.0.0;1.0.0
146+
com.azure.spring:azure-spring-boot-test-aad-resource-server-by-filter;1.0.0;1.0.0
145147
com.azure.spring:azure-spring-boot-test-core;1.0.0;1.0.0
146148
com.azure.spring:azure-spring-boot-test-cosmosdb;1.0.0;1.0.0
147149
com.azure.spring:azure-spring-boot-test-keyvault;1.0.0;1.0.0

sdk/spring/azure-spring-boot-test-aad/HOW_TO_RUN_AAD_INTEGRATION_TEST_IN_LOCALHOST.md renamed to sdk/spring/HOW_TO_RUN_AAD_INTEGRATION_TEST_IN_LOCALHOST.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ Get `AAD_TENANT_ID_2`, `AAD_USER_NAME_2`, `AAD_USER_PASSWORD_2` with the same me
6060

6161
4. Add API permissions. Grant admin consent.
6262
![add-api-permission](images/add-api-permission.png)
63+
64+
5. Expose API: `ResourceAccessGraph.Read`, `TestScope1`, `TestScope2`.
65+
![expose-api](images/expose-api.png)
6366

64-
5. Now we get value of `AAD_MULTI_TENANT_CLIENT_ID`, `AAD_MULTI_TENANT_CLIENT_SECRET`.
67+
6. Now we get value of `AAD_MULTI_TENANT_CLIENT_ID`, `AAD_MULTI_TENANT_CLIENT_SECRET`.
6568

6669
### `AAD_SINGLE_TENANT_CLIENT_ID`, `AAD_SINGLE_TENANT_CLIENT_SECRET`
6770
Get `AAD_SINGLE_TENANT_CLIENT_ID`, `AAD_SINGLE_TENANT_CLIENT_SECRET` with the same method.
@@ -102,10 +105,22 @@ $env:AAD_SINGLE_TENANT_CLIENT_SECRET_WITH_ROLE='xxxxxxxx'
102105
```
103106

104107
## Run AAD integration test by maven.
105-
Command:
108+
azure-spring-boot-test-aad:
106109
```
107110
mvn -f .\sdk\spring\azure-spring-boot-test-aad\pom.xml --fail-at-end "-Dmaven.javadoc.skip=true" "-Drevapi.skip=true" "-DskipSpringITs=false" verify
108111
```
112+
azure-spring-boot-test-aad-obo:
113+
```
114+
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
115+
```
116+
azure-spring-boot-test-aad-resource-server:
117+
```
118+
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
119+
```
120+
azure-spring-boot-test-aad-resource-server-by-filter:
121+
```
122+
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
123+
```
109124

110125

111126
[Create a new tenant in Azure Active Directory]: https://docs.microsoft.com/azure/active-directory/fundamentals/active-directory-access-create-new-tenant

sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-stateless/README.md renamed to sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-by-filter-stateless/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ data: {
9191

9292
### Run with Maven
9393
```shell
94-
cd azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-stateless
94+
cd azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-by-filter-stateless
9595
mvn spring-boot:run
9696
```
9797

sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-stateless/docs/demo.webp renamed to sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-by-filter-stateless/docs/demo.webp

File renamed without changes.

sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-stateless/pom.xml renamed to sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-by-filter-stateless/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</parent>
1212

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

1717
<name>Azure Spring Boot Starter Sample - Azure AD Stateless Spring Security Integration</name>

sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-stateless/src/main/java/com/azure/spring/sample/aad/AzureADStatelessBackendSampleApplication.java renamed to sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-by-filter-stateless/src/main/java/com/azure/spring/sample/aad/AzureADStatelessBackendSampleApplication.java

File renamed without changes.

sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-stateless/src/main/java/com/azure/spring/sample/aad/controller/MainController.java renamed to sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-by-filter-stateless/src/main/java/com/azure/spring/sample/aad/controller/MainController.java

File renamed without changes.

sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-stateless/src/main/java/com/azure/spring/sample/aad/security/AADWebSecurityConfig.java renamed to sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-by-filter-stateless/src/main/java/com/azure/spring/sample/aad/security/AADWebSecurityConfig.java

File renamed without changes.

sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-stateless/src/main/resources/application.properties renamed to sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-by-filter-stateless/src/main/resources/application.properties

File renamed without changes.

sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-stateless/src/main/resources/static/index.html renamed to sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server-by-filter-stateless/src/main/resources/static/index.html

File renamed without changes.

0 commit comments

Comments
 (0)