-
Notifications
You must be signed in to change notification settings - Fork 2k
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
For AAD resource-server, create grantedAuthority by both "roles" and "claims" by default. #19412
For AAD resource-server, create grantedAuthority by both "roles" and "claims" by default. #19412
Conversation
…"claims" by default.
for (String claimName : WELL_KNOWN_AUTHORITIES_CLAIM_NAMES) { | ||
if (jwt.containsClaim(claimName)) { | ||
Object authorities = jwt.getClaim(claimName); | ||
if (authorities instanceof String) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about
if ( jwt.getClaim(claimName) instanceof String)
* Simplify the code, remove unnecessary variables.
* Update unit tests.
* Remove setJwtGrantedAuthoritiesConverter method.
…claims_by_default
…edAuthoritiesConverter` method.
.../src/test/java/com/azure/spring/aad/webapi/AADJwtBearerTokenAuthenticationConverterTest.java
Show resolved
Hide resolved
.../src/test/java/com/azure/spring/aad/webapi/AADJwtBearerTokenAuthenticationConverterTest.java
Show resolved
Hide resolved
when(jwt.containsClaim("roles")).thenReturn(true); | ||
AADJwtBearerTokenAuthenticationConverter converter = new AADJwtBearerTokenAuthenticationConverter("roles", "ROLE_"); | ||
AADJwtBearerTokenAuthenticationConverter converter = new AADJwtBearerTokenAuthenticationConverter("roles", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use roles + "APPROLE_" as a default, maybe we should use another combination here.
/azp run java - spring - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
IT failed for |
/check-enforcer override |
Hi just wondering why you chose The affect of this is that you now MUST use From https://www.baeldung.com/spring-security-expressions
|
ok no bigggie so i worked out we can pass our own converter in AADResourceServerWebSecurityConfigurerAdapter like this |
Mitryakh/network 2022 01 01 (Azure#19412) * Adds base for updating Microsoft.Network from version stable/2021-08-01 to version 2022-01-01 * Updates readme * Updates API version in new specs and examples * Updated Explicit proxy settings by adding one boolean field to it (Azure#19011) * API for provider port (Azure#19041) * Update readme.md * Create expressRouteProviderPort.json * Create expressRouteProviderPortList.json * Create expressRouteProviderPort.json * Update custom-words.txt * Update expressRouteProviderPort.json * Update expressRouteProviderPortList.json * Update expressRouteProviderPort.json * Add WAF match variable operators (Azure#18925) ### webapplicationfirewall.json * Add GreaterThanOrEquals operator and Any operator to custom rule match conditions in WAF policy spec * Add VirtualHub Router autoscale configuration (Azure#19131) Co-authored-by: Andrii Kalinichenko <[email protected]> * Adding rule priority to Tls Proxy routing rule object model (Azure#19135) Co-authored-by: Vinay Mundada <[email protected]> * swagger changes for new ssl policies (Azure#19183) * Update Swagger Spec for VMSS Packet Capture (Azure#19202) * Update Swagger Spec for VMSS Packet Capture * Remove extra line * Update Swagger spec for Connection Monitor VMSS (Azure#19203) * Adding new endpoint in ConnectionMonitor * Changing ConnectionMonitor endpoints order * Add flushConnection to NSG (Azure#19085) * Merge NetworkManger into 2022-01-01 (Azure#19169) * Merge NetworkManger into 2022-01-01 * Remove EffectiveVnet APIs * Remove SecurityUser Resource * update readme * Fix as comments * fix as comments * remove network group type * Add new parameter noInternetAdvertise to CustomIPPrefix (Azure#19340) * fix * fix Co-authored-by: Weiheng Li <[email protected]> * Route Server Integration feature swagger changes (Azure#19215) * Route Server Integration feature swagger changes * prettier run changes * updating api version in examples file * fixing test errors * fixing test errors * fixing modelvalidation errors * fixing test errors * fixing modelvalidation errors * changes based on review comments * fixing lintdiff failure * updating examples * update wrong enum value for customipprefix (Azure#19382) * fix * fix * fix Co-authored-by: Weiheng Li <[email protected]> * Updated ExplicitProxySettings to ExplicitProxy on Firewall Policy ver2022-01-01 (Azure#19299) Co-authored-by: Gizachew Eshetie <[email protected]> * Add resource type (Azure#19434) Co-authored-by: Andrii Kalinichenko <[email protected]> * Fix prettier errors (Azure#19462) Co-authored-by: Andrii Kalinichenko <[email protected]> Co-authored-by: uditmisra52 <[email protected]> Co-authored-by: jashsing-mic <[email protected]> Co-authored-by: Anurag Kishore <[email protected]> Co-authored-by: AndriiKalinichenko <[email protected]> Co-authored-by: Andrii Kalinichenko <[email protected]> Co-authored-by: Vinay Jayant Mundada <[email protected]> Co-authored-by: Vinay Mundada <[email protected]> Co-authored-by: kaushik-ms <[email protected]> Co-authored-by: snagpal99 <[email protected]> Co-authored-by: kumaam <[email protected]> Co-authored-by: Satya-anshu <[email protected]> Co-authored-by: yanfa317 <[email protected]> Co-authored-by: Weiheng Li <[email protected]> Co-authored-by: Weiheng Li <[email protected]> Co-authored-by: Anchal Kapoor <[email protected]> Co-authored-by: Gizachew-Eshetie <[email protected]> Co-authored-by: Gizachew Eshetie <[email protected]>
For AAD resource-server, create grantedAuthority by both "roles" and "claims" by default.