-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Description
Expected Behavior
Inside OAuth2LoginConfigurer during init method when postProcess method invoked for OidcAuthorizationCodeAuthenticationProvider do not cast it to OidcAuthorizationCodeAuthenticationProvider but use interface AuthenticationProvider to provide ability to decorate provider inside custom ObjectPostProcessor.
Current Behavior
Inside OAuth2LoginConfigurer during init method when postProcess method invoked for OidcAuthorizationCodeAuthenticationProvider the result object is casted to OidcAuthorizationCodeAuthenticationProvider
Code reference:
OAuth2UserService<OidcUserRequest, OidcUser> oidcUserService = getOidcUserService();
OidcAuthorizationCodeAuthenticationProvider oidcAuthorizationCodeAuthenticationProvider = new OidcAuthorizationCodeAuthenticationProvider(accessTokenResponseClient, oidcUserService);
.....
oidcAuthorizationCodeAuthenticationProvider = this.postProcess(oidcAuthorizationCodeAuthenticationProvider);
http.authenticationProvider(oidcAuthorizationCodeAuthenticationProvider);
Context
I want to decorate AuthenticationProvider behaviour to invoke some logic before main provider and after.
Alternative is to extend OidcAuthorizationCodeAuthenticationProvider and make a decorator from this class but it looks bad, because i need to inject non null accessTokenResponseClient, oidcUserService parameters (some dummy implementations). Based on code improvement shouldn't be complex.