Closed fxpaquette closed 1 year ago
Hi, @fxpaquette thanks for reaching out, our repo has to be migrated to azure-sdk-for-java, so I copied the current issue to that repo, let's use that issue to track.
Closing this, redirect to https://github.com/Azure/azure-sdk-for-java/issues/33560.
Is your feature request related to a problem? Please describe. When application_type is resourceserver, users can define a custom claimToAuthorityPrefix (defaults to "APPROLE") with the property
spring.cloud.azure.active-directory.resource-server.claim-to-authority-prefix-map.roles
. However, for web_application the prefix is hardcoded inside the AadOAuth2UserService.extractRolesFromIdToken method.AadOAuth2UserService.java
Describe the solution you'd like Let users define the claimToAuthorityPrefix when application_type is web_application or web_application_and_resource_server by adding a similar property as
spring.cloud.azure.active-directory.resource-server.claim-to-authority-prefix-map.roles
and using this property in the above method.Describe alternatives you've considered For now, I think the alternative is to create an
OAuth2UserService
bean by extending theAadOAuth2UserService
class and overriding theextractRolesFromIdToken
method.Additional context I am using spring-cloud-azure-starter-active-directory 6.0.0-beta.3
Information Checklist