K2

SQL User Impersonation with K2

SQL User Impersonation with K2

SQL Server impersonation, or context switching, is a means to allow K2 to assume the permissions of a given user or login when executing your SQL queries. Under the covers this functionality makes use of K2 Pass-through Authentication.

To enable SQL Server impersonation you first need to register the SQL server service instance, by right-clicking on the ‘SQL Server Service’ in the ServiceObject Explorer, and then select ‘Impersonate as your Authentication Mode, as indicated in the screenshots below:

1 Register a new SQL Server Service Instance in K2

1 Register a new SQL Server Service Instance in K2

sql user impersonation with k2

2 Set SQL Server Service Instance to Impersonate in K2

For this functionality to work you then need to create a database user in the specific database, and then grant the K2 Service Account impersonation rights on the login you created. the following SQL accomplishes this.

3 Grant SQL Impersonation rights

3 Grant SQL Impersonation rights

Note that although you can grant login’s to the database on a windows group level, impersonation rights need to be giving for each specific user, and will not work on a group level.

Read more about K2 and creating business applications

SQL User Impersonation with K2

You may also like

Leave a comment

PODCAST  |  Why you need to establish a K2 Center of Excellence today

Interview with Arno van Rooyen, CEO, Velocity