0

I've been working with the default database model provided by Spring Security to authenticate users. I've realized that Spring Security looks for these tables in the default schema configured for the database engine.

Now, suppose the following:

You are working with PostgreSQL and you have 2 schema: schemaOne and schemaTwo, where schemaOne is configured as the dafault one for the engine. Then, suppose that you have an application that uses schemaTwo, then you will need Spring Security database model to be in that schema. So, once you try to run your application, Spring Security will try to look for the authentication model in schemaOne.

So, my question is: is there a way to push Spring Security to use a different schema than the default one configured for the database engine?.

Thank you.

gvalenncia
  • 151
  • 1
  • 9
  • Maybe useful: http://stackoverflow.com/questions/4168689/is-it-possible-to-specify-schema-when-connecting-to-postgres-with-jdbc – holmis83 Jun 01 '15 at 12:13

1 Answers1

0

Well, you can configure custom JDBC queries, for example:

  • With XML - override authorities-by-username-query, etc.
  • With JavaConfig - set authoritiesByUsernameQuery(String), etc.

But, I don't think you can just set the schema name.

pioto
  • 2,082
  • 19
  • 34