Baeldung / spring-security-oauth

Getting Started withg Spring Security OAuth:
http://bit.ly/github-lsso
MIT License
1.99k stars 1.95k forks source link

I can't connect to sql server db #351

Closed lamoboos223 closed 1 year ago

lamoboos223 commented 1 year ago

Hi in this project i tried to create storage provider like what you did: https://github.com/Baeldung/spring-security-oauth/tree/master/oauth-rest/keycloak-custom-providers

i added the sql server dependency in POM

        <dependency>
            <groupId>com.microsoft.sqlserver</groupId>
            <artifactId>mssql-jdbc</artifactId>
            <version>7.2.2.jre8</version>
        </dependency>

but i get this error when invoking the storage provider:

No suitable driver found for jdbc:sqlserver://localhost:1433;databaseName=peopledb;user=sa;password=Keycloak@123

please advise. I don't think that keycloak is seeing the sql server jar.

ulisseslima commented 1 year ago

Hey, @lamoboos223.

The "no suitable driver found" error usually happens when the driver is in the wrong place, or there's something wrong with the DB URL syntax.

From your message, it's unclear how you're running Keycloak or if it has access to that mssql-jdbc jar (it should be in the Keycloak lib folder as well, not only your custom provider project).

That will require some troubleshooting on your part. These might help:

Unfortunately, we can only help with questions that are specifically and directly related to the article - not with your own custom application.

StackOverflow is a great place to ask more general questions.

If you can reproduce the issue on our codebase, please create a pull request with this, and we’ll look into it.