You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sdk/spring/azure-spring-boot-starter-active-directory/README.md
+17-7Lines changed: 17 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -159,7 +159,7 @@ Refer to different samples for different authentication ways.
159
159
160
160
**Note**: `AADAppRoleStatelessAuthenticationFilter` and `AADAuthenticationFilter` will be deprecated. [Click here](https://github.com/Azure/azure-sdk-for-java/issues/17860) to replace it.
161
161
162
-
### Authenticate in web apps [Web apps]
162
+
### [Web APP]Authenticate in web app
163
163
Please refer to [azure-spring-boot-sample-active-directory-webapp] for authenticate in web apps.
164
164
165
165
#### Configure application.yml:
@@ -188,7 +188,7 @@ public class AADOAuth2LoginConfigSample extends AADWebSecurityConfigurerAdapter
188
188
}
189
189
```
190
190
191
-
### Configure scopes of multiple resources[Web apps]
191
+
### [Web APP]Configure scopes of multiple resources
192
192
By default, `azure-spring-boot-starter-active-directory` configures scopes of `openid`, `profile` and `https://graph.microsoft.com/user.read` to implement OpenID Connect protocol and access of membership information of logging in users.
193
193
194
194
To customize scope configurations of multiple resources, developers need to configure the registration id and scopes in the `application.yml` as needed. Here the {registration-id} is defined by developers themselves to generate correspondding `OAuth2AuthorizedClient` to acquire access tokens, and scope names should follow the specification of `resource-uri/permission`.
To configure the authorization of certain resource as on-demand, developers need to add following property in `application.yml`:
207
207
```yaml
208
208
azure:
@@ -213,7 +213,7 @@ azure:
213
213
scopes: {scope1}, {scope2}
214
214
```
215
215
216
-
### Protect the resource APIs in resource server [Web APIs]
216
+
### [Web API] Protect the resource APIs in resource server
217
217
Please refer to [azure-spring-boot-sample-active-directory-resource-server] for access resource APIs.
218
218
219
219
#### Include the package
@@ -250,7 +250,7 @@ public class AADOAuth2ResourceServerSecurityConfig extends WebSecurityConfigurer
250
250
}
251
251
```
252
252
253
-
### OAuth 2.0 On-Behalf-Of flow [Web APIs]
253
+
### [Web API] OAuth 2.0 On-Behalf-Of flow
254
254
Please refer [azure-spring-boot-sample-active-directory-resource-server-obo] to for access On-Behalf-Of flow.
255
255
256
256
#### Include the package
@@ -314,7 +314,7 @@ azure:
314
314
}
315
315
```
316
316
317
-
### Authenticate in web APIs [Web APIs]
317
+
### [Web API] (Deprecated) Authenticate in web API by a filter
318
318
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.
319
319
320
320
#### Configure application.yml:
@@ -341,7 +341,7 @@ public class AADAuthenticationFilterConfigSample extends WebSecurityConfigurerAd
341
341
* Role-based Authorization with annotation `@PreAuthorize("hasRole('GROUP_NAME')")`
342
342
* Role-based Authorization with method `isMemberOf()`
343
343
344
-
### Authenticate stateless web APIs using AAD app roles [Web APIs]
344
+
### [Web API] (Deprecated) Authenticate stateless web API by a filter, using AAD app roles
345
345
This scenario fits best for stateless Spring backends exposing an API to SPAs ([OAuth 2.0 implicit grant flow]) or service-to-service access using the [client credentials grant flow].
346
346
The stateless processing can be activated with the `azure.activedirectory.session-stateless` property. The authorization is using the [AAD App Roles feature], so instead of using the `groups` claim the token has a `roles` claim which contains roles [configured in your manifest].
347
347
@@ -395,6 +395,15 @@ public class AADAppRoleStatelessAuthenticationFilterConfigSample extends WebSecu
395
395
396
396
The roles you want to use within your application have to be [set up in the manifest of your application registration].
397
397
398
+
### [Web APP & Web API] Use Azure China instead of Azure Global
399
+
If you use [Azure China] instead of **Azure Global**, you need to configure your `application.yml`:
Azure SDKs for Java offers a consistent logging story to help aid in troubleshooting application errors and expedite their resolution. The logs produced will capture the flow of an application before reaching the terminal state to help locate the root issue. View the [logging][logging] wiki for guidance about enabling logging.
@@ -446,3 +455,4 @@ Please follow [instructions here] to build from source or contribute.
[set up in the manifest of your application registration]: https://docs.microsoft.com/azure/active-directory/develop/howto-add-app-roles-in-azure-ad-apps
Copy file name to clipboardExpand all lines: sdk/spring/azure-spring-boot/src/main/java/com/azure/spring/autoconfigure/aad/AADAuthenticationProperties.java
0 commit comments