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
I understand that it is difficult (impossible?) to come provide implementations that work out of the box with all DBs but it would be helpful if the default implementations were simpler to customize.
For example, I'm finding that customizing JdbcOAuth2AuthorizationService to handle mariadb to be somewhat cumbersome.
The mariadb jdbc driver, for some reason that is not entirely clear to me, sets the BLOB column type to LONGVARBINARY which JdbcOAuth2AuthorizationService does not handle. It seemed that the simplest way to deal with this was to override a method and map LONGVARBINARY to BLOB so that the rest of the code could handle it without further changes.
That is simple enough with JdbcOAuth2AuthorizationService.OAuth2AuthorizationParametersMapper#apply with something like:
A similar operation would be required for JdbcOAuth2AuthorizationService#findBy but that method is private so it's not possible to override and overriding the findBy methods that call findBy is not feasible because those method rely heavily on private static members.
The only option that I had, short of completely writing my own implementation, was to make a copy JdbcOAuth2AuthorizationService and make one simple change:
I don't think this is a duplicate of #550. In that ticket the suggestion is to customize the implementation using a custom OAuth2AuthorizationParametersMapper specific to the database in use. That however does not allow to customize all of the database specific code.
The problem is that JdbcOAuth2AuthorizationService uses some database-specific code internally that is not customizable because it's private and/or static.
Ideally the implementation should be as generic as possible and should allow database-specific adaptations to be made without having to duplicate the whole class.
I understand that it is difficult (impossible?) to come provide implementations that work out of the box with all DBs but it would be helpful if the default implementations were simpler to customize.
For example, I'm finding that customizing JdbcOAuth2AuthorizationService to handle mariadb to be somewhat cumbersome.
The mariadb jdbc driver, for some reason that is not entirely clear to me, sets the BLOB column type to LONGVARBINARY which JdbcOAuth2AuthorizationService does not handle. It seemed that the simplest way to deal with this was to override a method and map LONGVARBINARY to BLOB so that the rest of the code could handle it without further changes.
That is simple enough with JdbcOAuth2AuthorizationService.OAuth2AuthorizationParametersMapper#apply with something like:
A similar operation would be required for JdbcOAuth2AuthorizationService#findBy but that method is private so it's not possible to override and overriding the findBy methods that call findBy is not feasible because those method rely heavily on private static members.
The only option that I had, short of completely writing my own implementation, was to make a copy JdbcOAuth2AuthorizationService and make one simple change:
To my mind, a wholesale copy of a class just to make such a simple change is a bit of overkill.
The text was updated successfully, but these errors were encountered: