K2 blackpearl 0807 and custom security providers
KB000331
PRODUCTSEE ALSO How to register a Security Provider
Introduction
This requirement applies to the assembly that implements the secuirty interface, for example IHostableSecurityProvider and excludes the assembly(ies) that are referenced by the assembly implementing the interface.
To clarify this: If assembly A implements IHostableSecurityProvider, and assembly A references assembly B then only Assembly A must be registered in the K2 Database. Assembly A must be copied into the [Install Directory]K2 blackpearlHost ServerinSecuirtyProviders and assembly B, the referenced assembly(ies) must be copied to [Install Directory]K2 blackpearlHost Serverin.
How to register the assembly
The steps required to register the assembly are provided below:- The assembly that contains your Security Provider, must be signed. Get the public key token for the assembly. To obtain the Public token key do the following
- Open the Visual Studio command promt
- Type: sn.exe -T [full path to strong named assembly]
- Run the following script against the Host Server database: INSERT INTO [HostServer].[dbo].[AssemblyRegistration]
([AssemblyID]
,[AssemblyName]
,[PublicKeyToken]
,[Enabled])
VALUES
(newid()
,'[AssemblyName]'
,'[PublicKeyToken]'
,1)Where [AssemblyName] is the name of the assembly example: SourceCode.Security.Providers.SampleProvider (excluding the ‘.dll’, i.e. not the strong name) Where [PublicKeyToken] is the public key token that you signed the assembly with, obtained in step 1.
- Make the following change to the [Install Dir]k2 blackpearlHost ServerBinK2HostServer.config file <appSettings>
...
<add key="useassemblyregistration" value="true" />
...
</appSettings> - Restart the K2Server.