-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Authorization server can't run on PostgresSQL out of the box #420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Here is my draft code Changed SQL table Impl for PostgresJdbcAuthorizationService
This is workaround for using Postgres and VARCHAR instead of BLOB. |
hi. This is the default behavior. See comment,
The configuration can be customized as mentioned in this comment which is similar with your proposed solution. |
Thanks, I saw mentioned issues, this one is enhancement which I think may be useful to have it. There is workaround for this, just maybe to consider adding the better way to override behavior, this way I had to take a lot of code from JdbcOAuth2AuthorizationService in order to have working solution. |
The ObjectMapper issue can be resolved by creating a mixin for |
Technically the only thing that would need to be done is to use TYPES.BINARY instead of TYPES.BLOB. This is already possible for the save method, but the findBy methods don't provide a hook for us to substitute BINARY for BLOB. Please consider providing some form of hook/setting to allow us to to do so. |
Hi @vladimir-cirkovic, thanks for your interest in the project. As @ovidiupopa91 mentioned, our current approach is to provide a standard sql implementation using JDBC, which is also consistent with the corresponding component in Spring Security. We will however take your feedback under advisement, so thanks for providing it. You may also be interested in implementing this using Spring Data. See this gist if you're interested in trying that approach: JpaOAuth2AuthorizationService I'm going to close this for now, but we will keep an eye on this issue as we move forward. |
Congratulations to the core team for bringing out the Authorization server out !!! Even when we try to change the BLOB to the other supported datatypes like BYTEA / varchar, since the type conversion was strict, its not allowing to use other BLOB equivalent data types and its better the framework uses ORM specifications (JPA) so that most of the databases are supported. https://gist.github.com/sjohnr/463448fc00cf6059dd2892aed1e63d3c Please provide some best practices on top of the releases!!! Problem Statement: If we can have the Types as "VARCHAR", then it would be easy or use JPA instead of spring-jdbc as part of the framework since there are not much entities to configure!!!! |
@santhosh1215 Please see gh-444 |
Expected Behavior
Plug and Play postgres database.
Current Behavior
JdbcOAuth2AuthorizationService doesn't allow changing of authorizationRowMapper, authorizationParametersMapper to support usage of databases which doesn't have blob type. When those mappers are changed, objectMapper return following issue
The class with org.springframework.security.ldap.userdetails.LdapUserDetailsImpl and name of org.springframework.security.ldap.userdetails.LdapUserDetailsImpl is not in the allowlist. If you believe this class is safe to deserialize, please provide an explicit mapping using Jackson annotations or by providing a Mixin. If the serialization is only done by a trusted source, you can also enable default typing. See https://github.com/spring-projects/spring-security/issues/4370
Context
This issue is related to postgres database, just I see that auth server can't be used easily with one of the most popular open source database.
The text was updated successfully, but these errors were encountered: