.NET Integration Kit

Integrating the OpenToken agent into your .NET application

To use the .NET Integration Kit, modify your application to use the OpenToken Agent.

The agent API allows your web application to directly read or write an OpenToken package.

Instantiate the OpenToken Agent by invoking a constructor and loading the agent-config.txt configuration file that you saved in Configuring an OpenToken SP Adapter instance. This configuration file includes the name of the cookie that the agent object will write, as well as the key to use when encrypting a new OpenToken. If the agent does not find an agent-config.txt file, it throws an exception.

Sample code

Modify your .NET application based on the following sample code.

using System;using System.
Collections.Generic;
using System.Text;
using opentoken;
using System.IO;
using opentoken.util;
using System.Collections;
using System.Collections.Generic;
. . . .
Agent agent = new Agent( “<PATH_TO_FILE>/agent-config.txt”);