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
- The Spring Authorization Server recommends using functional interfaces for validation (https://docs.spring.io/spring-authorization-server/reference/protocol-endpoints.html).
- Instead of applying OAuth2ClientCredentialsAuthenticationContext, additional parameters from OAuth2ClientAuthenticationToken were used. I could create OAuth2ClientCredentialsAuthenticationContext in OpaqueGrantTypeAuthenticationProvider, but I believe that would be a bit overkill.
- Renamed RegisteredClientRepositoryImpl to CacheableRegisteredClientRepositoryImpl to reflect its original caching functionality.
Copy file name to clipboardExpand all lines: client/src/test/java/com/patternhelloworld/securityhelper/oauth2/client/integration/auth/TokenIntegrationTest.java
Copy file name to clipboardExpand all lines: lib/src/main/java/io/github/patternhelloworld/securityhelper/oauth2/api/config/security/converter/auth/endpoint/TokenRequestAfterClientBasicSecretAuthenticatedConverter.java
Copy file name to clipboardExpand all lines: lib/src/main/java/io/github/patternhelloworld/securityhelper/oauth2/api/config/security/provider/auth/endpoint/authorization/AuthorizationCodeAuthenticationProvider.java
+1-3
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@
13
13
* See the License for the specific language governing permissions and
@@ -56,41 +59,26 @@ public Authentication authenticate(Authentication authentication)
56
59
try {
57
60
if (authenticationinstanceofOAuth2ClientAuthenticationTokentoken) {
58
61
59
-
// [NOTICE] If an incorrect client ID or Secret is detected, the OpaqueGrantTypeAccessTokenRequestConverter is not be invoked, which means there is NO mandatory client_id header parameter.
60
-
// For reference, if an incorrect Basic header, such as base64(client_id:<--no secret here-->), is detected, the ClientSecretBasicAuthenticationConverter handles it directly and passes it to the AuthenticationFailureHandler.
thrownewEasyPlusOauth2AuthenticationException(EasyPlusErrorMessages.builder().message("Invalid Request. OpaqueGrantTypeAccessTokenRequestConverter was not invoked. This may indicate incorrect payloads or expired code or code_verifier.").userMessage(iSecurityUserExceptionMessageService.getUserMessage(DefaultSecurityUserExceptionMessage.AUTHENTICATION_LOGIN_ERROR)).build());
thrownewEasyPlusOauth2AuthenticationException("authorization code not found");
70
+
thrownewEasyPlusOauth2AuthenticationException(EasyPlusErrorMessages.builder().message("No user info found for the authorization code").userMessage(iSecurityUserExceptionMessageService.getUserMessage(DefaultSecurityUserExceptionMessage.AUTHENTICATION_LOGIN_FAILURE)).build());
thrownewEasyPlusOauth2AuthenticationException(EasyPlusErrorMessages.builder().message("client_id NOT found in DB").userMessage(iSecurityUserExceptionMessageService.getUserMessage(DefaultSecurityUserExceptionMessage.AUTHENTICATION_LOGIN_ERROR)).build());
Copy file name to clipboardExpand all lines: lib/src/main/java/io/github/patternhelloworld/securityhelper/oauth2/api/config/security/serivce/persistence/authorization/OAuth2AuthorizationServiceImpl.java
0 commit comments