1

I have an SQL Server database hosted on azure. It can access using the Azure Active Directory Service Principal. I'm trying to deploy keycloak (16.1.0) on AKS and configure the database mentioned earlier. I have an application that can connect to that SQL Server using the Azure Active Directory Service Principal. But using keycloak, it has no luck.

I have used JDBC_PARAMS="authentication=ActiveDirectoryServicePrincipal" to configure database properties in keycloak.

Thanks

Dale K
  • 25,246
  • 15
  • 42
  • 71
Damith Udayanga
  • 726
  • 7
  • 18

1 Answers1

1

Deploying keycloak on AKS

Please Follow this doc:

Connect to that SQL Server using the Azure Active Directory Service Principal

Active Directory Service Principal authentication mode, the client application can connect to Azure SQL data sources by providing the client ID and secret of a service principal identity. Service principal authentication involves:

  1. Setting up an app registration with a secret.

  2. Granting permissions to the app in the Azure SQL Database instance.

  3. Connecting with the correct credential.

Grant access to Azure SQL Database

We need to give your application access to the Azure SQL Database service. This is done through the API Permissions.

Reference 1

Add client authentication

In order to authenticate Active Directory representation of it, switch over to Certificates and create a New client secret.

The following example shows how to use Active Directory Service Principal authentication

Reference 2

The following example shows how to use Active Directory Service Principal authentication.

// Use your own server, database, app ID, and secret.
string ConnectionString = @"Server=demo.database.windows.net; Authentication=Active Directory Service Principal; Database=testdb; User Id=App Id; Password=secret";

using (SqlConnection conn = new SqlConnection(ConnectionString)) {
    conn.Open();
}

Refer this link .

B. B. Naga Sai Vamsi
  • 2,386
  • 2
  • 3
  • 11
  • I have already configured the Service principal configuration on the SQL server. also, add new latest driver version as per the following document. but it is not working. https://learn.microsoft.com/en-us/sql/connect/jdbc/connecting-using-azure-active-directory-authentication?view=sql-server-ver15 – Damith Udayanga Mar 25 '22 at 12:03