K2 blackpearl Product Documentation: Installation and Configuration Guide
Dynamic SQL Server Configuration Requirements

Setup Requirements

The following configuration prerequisites are required

  1. The K2 Server must run under an account [Domain Name]/K2Service account
  2. Within Active Directory there is an user group called ‘Domain/SqlUsers’ which must contain the names of the users who want access to the specific database(s)
  3. The Active Directory user ‘Domain/SqlUser1’ which makes the delegated call

SQL Server Instance Configuration

These scripts need to be run once per SQL Server instance.

Map Login

For each SQL Server Instance, the following mappings need to be created:

The above configuration enables the SQL Server to resolve the AD group or user by associating the Windows SID to a SQL SID.

Both AD Groups and AD Users can be added that you can set up a whole AD Group as a LOGIN, it needn’t just be an AD User:
Associate Windows SID to SQL SID 
Copy Code
USE [master];
--Represent caller SID within SQL
CREATE LOGIN [Domain\SqlUsers] FROM WINDOWS;
--Represent service account SID within SQL
CREATE LOGIN [Domain\K2Service] FROM WINDOWS;
GO

Grant Impersonation Rights

The Grant IMPERSONATION rights on the K2 Host Server service account script enables the following actions:

Grant Impersonation Rights
Copy Code
USE [master];
--Allow one SID to impersonate as the other
GRANT IMPERSONATE ON LOGIN::[Domain\SqlUsers] TO [Domain\K2Service];
GO

Map Server Login to the Local DataBase Principle

The Impersonation rights granted above must be mapped to a database user:

Map Server Login to the Local Database Principle
Copy Code
USE [SalesDB];
--Map server LOGIN to a local database principle, in this case using
--the same name for convenience (can also use a different USER name)
CREATE USER [Domain\SqlUsers] FOR LOGIN [Domain\SqlUsers];
GO

Grant User Rights

Running this script would not normally be required, but if it is required then only once per SQL Server Instance

Grant User Rights
Copy Code

USE [SalesDB];
GRANT EXECUTE ON [dbo].[MyProcOrTable] TO [Domain\SqlUsers];
GO

 

 


K2 blackpearl Product Documentation: Installation and Configuration Guide 4.6.11