Conversation
ZhuXiaoBing-cn
commented
Nov 17, 2020
- Make changes according to checkstyle
- add unit tests
- pom file add resource-server dependencies
- spring.factories file add autoconfiguration
* add unit tests * pom file add resource-server dependencies * spring.factories file add autoconfiguration
* update AADResourceServerAutoConfiguration * update AADResourceServerAutoConfigurationTest
* issuer validator verify that the STS URI matches * Verify the audience through AppIdUri * update unit test * Update JwkKeySetUri to get via ServiceEndpoints
|
This pull request is protected by Check Enforcer. What is Check Enforcer?Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass. Why am I getting this message?You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged. What should I do now?If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows: What if I am onboarding a new service?Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment: |
...zure-spring-boot/src/main/java/com/azure/spring/autoconfigure/aad/AADJwtIssuerValidator.java
Outdated
Show resolved
Hide resolved
...re-spring-boot/src/main/java/com/azure/spring/autoconfigure/aad/AADJwtAudienceValidator.java
Show resolved
Hide resolved
| try { | ||
| jwsObject = JWSObject.parse(accessToken.getTokenValue()); | ||
| } catch (ParseException e) { | ||
| e.printStackTrace(); |
There was a problem hiding this comment.
should we throw this exception?
There was a problem hiding this comment.
We should have a log here.
...main/java/com/azure/spring/autoconfigure/aad/AzureJwtBearerTokenAuthenticationConverter.java
Outdated
Show resolved
Hide resolved
| import org.springframework.security.oauth2.jwt.JwtDecoder; | ||
| import org.springframework.security.oauth2.jwt.NimbusJwtDecoder; | ||
|
|
||
| public class AADResourceServerAutoConfigurationTest { |
There was a problem hiding this comment.
We need more test cases in this one
.../java/com/azure/spring/autoconfigure/aad/AzureJwtBearerTokenAuthenticationConverterTest.java
Show resolved
Hide resolved
...t/src/main/java/com/azure/spring/aad/resource/AzureActiveDirectoryResourceConfiguration.java
Outdated
Show resolved
Hide resolved
...t/src/main/java/com/azure/spring/aad/resource/AzureActiveDirectoryResourceConfiguration.java
Outdated
Show resolved
Hide resolved
...azure-spring-boot/src/main/java/com/azure/spring/aad/resource/AzureJwtAudienceValidator.java
Show resolved
Hide resolved
.../src/main/java/com/azure/spring/aad/resource/AzureJwtBearerTokenAuthenticationConverter.java
Outdated
Show resolved
Hide resolved
|
Please fix the spotbug error. |
...in/java/com/azure/spring/aad/resource/server/AzureJwtBearerTokenAuthenticationConverter.java
Outdated
Show resolved
Hide resolved
* add unit test
# Conflicts: # sdk/spring/azure-spring-boot/src/main/java/com/azure/spring/aad/implementation/AzureActiveDirectoryProperties.java
* For AzureOAuth2AuthenticatedPrincipal add multiple constructors, to implement change authoritiesClaimName, authorityPrefix. * Changes the PreAuthenticatedAuthenticationToken to BearerTokenAuthentication in AzureJwtBearerTokenAuthenticationConverter. * add unit test in AzureJwtBearerTokenAuthenticationConverterTest.
saragluna
left a comment
There was a problem hiding this comment.
Overall is great, we need to discuss the bearer token converter again, to see whether we use the correct abstraction here.
|
/azp run java - spring - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| import org.springframework.util.Assert; | ||
|
|
||
| /** | ||
| * A {@link Converter} that takes a {@link Jwt} and converts it into a {@link PreAuthenticatedAuthenticationToken}. |